Recursively Process Tree
Write a method that accepts a Node (and other args as needed): void doTree(Node node, . . .) { if (! node.hasChildNodes()) { process all leaf nodes according to node.getNodeType } else { NodeList l = node.getChildNodes(); for (int i = 0; i<l.getLength(); i++) { doTree ( item(i), . . . ); } } }