Here you can find the source of printNode(Node node)
public static void printNode(Node node)
//package com.java2s; //License from project: Open Source License import org.apache.log4j.Logger; import org.w3c.dom.Node; public class Main { protected static Logger logger = Logger.getLogger(new Object() { }.getClass().getEnclosingClass().getName()); public static void printNode(Node node) { logger.debug("--> printNode() " + node.getNodeName()); logger.debug("prefix=" + node.getPrefix() + ", baseuri=" + node.getBaseURI() + ", nsuri=" + node.getNamespaceURI() + ", value=" + node.getNodeValue()); if (node.getFirstChild() != null) { logger.debug("--> Child of " + node.getNodeName()); printNode(node.getFirstChild()); logger.debug("<-- Child of " + node.getNodeName()); }//w ww. j av a2 s. co m if (node.getNextSibling() != null) { logger.debug("--> Sibling of " + node.getNodeName()); printNode(node.getNextSibling()); logger.debug("<-- Sibling of " + node.getNodeName()); } logger.debug("<-- printNode() " + node.getNodeName()); } }