Java tutorial
//package com.java2s; import org.w3c.dom.Node; import org.w3c.dom.traversal.NodeIterator; public class Main { public static void printNodeIterator(NodeIterator iterator) { Node n; while ((n = iterator.nextNode()) != null) { System.out.println("Node:" + n.getNodeValue()); } } }