Showing a XML
The following has 2 ways for indenting to show the xml. 1. using the class TransformerFactory's setAttribute("indent-number", new Integer(20)); 2. using the class Transformer's setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2"); This way is higher priority than the first way. // Requires Java SE 1.7.0 TransformerFactory tf = TransformerFactory.newInstance(); //1. set the indented format of the additional whitespace when outputting the result tree; tf.setAttribute("indent-number", new Integer(20)); // It works. Transformer transformer = tf.newTransformer(); //2. set the indented format of the additional whitespace when outputting the result tree; This way is higher priority than the 1. tra...