Here you can find the source of printNodeIterator(NodeIterator iterator)
public static void printNodeIterator(NodeIterator iterator)
//package com.java2s; //License from project: LGPL import org.w3c.dom.Node; import org.w3c.dom.traversal.NodeIterator; public class Main { public static void printNodeIterator(NodeIterator iterator) { Node n;//www. ja v a 2 s. c om while ((n = iterator.nextNode()) != null) { System.out.println("Node:" + n.getNodeValue()); } } }