Here you can find the source of printDocumentTree(Node el)
public static void printDocumentTree(Node el)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.Node; public class Main { public static void printDocumentTree(Node el) { System.out.println(el.toString()); for (int i = 0; i < el.getChildNodes().getLength(); i++) printDocumentTree(el.getChildNodes().item(i)); }// ww w .jav a2 s. c o m }