0

I am desperately looking for a library or snippet to convert a XML Node into a string representing the Node element.

I only find String > XML guides. I found the Spring Shell library XmlUtils which had that functionality (in version v1.0.0.M1) but was broken due transient dependencies and therefore not possible to be used.

I also found Apache XMLUtils which have a similar functionality. Sadly the lib seems to be not maintained for more than 8 years or such. I am unsure to use it because of that.

EDIT: I found this one as the actual XMLUtils from Apache Axis2: https://mvnrepository.com/artifact/org.apache.axis2/axis2-kernel/1.7.9

But as I can see in the doc the wanted method has been removed (https://axis.apache.org/axis2/java/core/apidocs/org/apache/axis2/util/XMLUtils.html)

Did I missed something? Every Utils library I found has removed the functionality of converting an Element/Node into a String XML.

Am really in need of a good advice for the mentioned problem.

xetra11
  • 7,671
  • 14
  • 84
  • 159
  • So if I understand (and please correct me if I am wrong), you have a `Document` object (DOM in-memory object) and you want to write it out to a `String` as XML? You can do that with the JDK, you don't need external libraries. – Sean Bright Oct 18 '19 at 13:42
  • I have a `Document` and query for specific Elements of it and receive a `NodeList` back. Iterating over the `NodeList` I have a `Node` element I'd like to convert back to the XML String – xetra11 Oct 18 '19 at 13:44
  • Yes just found that @OldProgrammer vote to close – xetra11 Oct 18 '19 at 13:47

0 Answers0