What is the easiest way to pretty print (a.k.a. formatted) a org.w3c.dom.Document to stdout?
org.w3c.dom.Document
How about:
OutputFormat format = new OutputFormat(doc); format.setIndenting(true); XMLSerializer serializer = new XMLSerializer(System.out, format); serializer.serialize(doc);