Java tutorial
//package com.java2s; import org.apache.log4j.Logger; import org.w3c.dom.*; public class Main { static Logger log = null; public static void dumpNodeDetails(Node node) throws Exception { NamedNodeMap attributes = node.getAttributes(); for (int t = 0; t < attributes.getLength(); t++) { Node aNode = attributes.item(t); log.info("aName = " + aNode.getNodeName() + " : aValue = " + aNode.getNodeValue()); } } }