List of utility methods to do XML Transform
void | writeByTransformer(Node node, Writer writer, int indent) write By Transformer if (node.getNodeType() == Node.DOCUMENT_NODE) { ((Document) node).setXmlStandalone(true); try { Transformer transformer = TransformerFactory.newInstance().newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, indent == 0 ? "no" : "yes"); transformer.setOutputProperty(OutputKeys.METHOD, "xml"); transformer.setOutputProperty(OutputKeys.ENCODING, "utf-8"); ... |