Convert XML file to String Object in Java.

Hello Friends,

This is one of my tutorials in java with respect to XML, to convert xml file to string. Sometimes while working with web-services we may come accross with the requirements of sending the updates to the web-service via a XML file. For the same you may need to convert the XML file into a stream of String (however we can pass XML file to web-services for updation). But, at some times if you need to update the values or attributes of the XML and then send it as String then following code will do it for you.

There are some jars needed to be set in your buildpath, you can download them from here.

Hope this will help you.

Regards,

Nikhil Naoghare.

Leave a Comment

Your email address will not be published. Required fields are marked *