List of utility methods to do XML String Format
String | prettyPrint(String unformattedXml) pretty Print try { Transformer transformer = TransformerFactory.newInstance() .newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOutputProperty( "{http://xml.apache.org/xslt}indent-amount", "2"); StreamResult result = new StreamResult(new StringWriter()); StreamSource source = new StreamSource(new StringReader( ... |
String | header() header return "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; |