What is the easiest way to pretty print (a.k.a. formatted) a org.w3c.dom.Document to stdout?
org.w3c.dom.Document
Try jcabi-xml with one liner:
String xml = new XMLDocument(document).toString();
This is the dependency you need:
com.jcabi jcabi-xml 0.14