This discussion is archived
3 Replies Latest reply: Nov 6, 2008 6:13 AM by 843785 RSS

How To Convert XML into String?

843785 Newbie
Currently Being Moderated
Hi,

I have a requirement in which I need to convert the data from XML file to string.

E.g.

< HookupDrawing>
< DrawingSpecification>
<Header>
<SoldTo>SUN</SoldTo>
<SoldToName>Microsystems</SoldToName>
< StartDate/>
<Manager>Mr.John</Manager>
< PlantName>America</ PlantName>
</Header>
< LineItems>
< LineItem>
< MaterialNumber>MatNum123</ MaterialNumber>
<FamilyNumber>FamilyName123</FamilyNumber>
</ LineItem>
</LineItems>
< ClientId>ClientID123</ ClientId>
<FileName>FileName123</FileName>
< DrawingType/>
< TemplateName/>
</DrawingSpecification>
<DrawingImage contentType=""/>
< /HookupDrawing>

Output should be like:
< File>
< Content>SUN Microsystems Mr.John America MatNum123 FamilyName123 ClientID123 FileName123</Content>
< /File>

As I am a novice in JAVA it will be very helpful to me if you provide me the exact and complete solution.

Thanks,
Abhishek