Here you can find the source of dump(Node node)
public static void dump(Node node)
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.FileOutputStream; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; import org.w3c.dom.Node; public class Main { public static void dump(Node node) { try {/*from ww w .j ava 2 s .c o m*/ TransformerFactory fac = TransformerFactory.newInstance(); Transformer t = fac.newTransformer(); FileOutputStream fos = new FileOutputStream(new File("xsl.xsl")); t.transform(new DOMSource(node), new StreamResult(fos)); fos.close(); } catch (Exception e) { e.printStackTrace(); } } }