serializer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
// Use the simple XPath API to select a nodeIterator.
// System.out.println("Querying DOM using " + xpath);
NodeIterator nl = XPathAPI.selectNodeIterator(doc, xpath);
// Serialize the found nodes to System.out.
// System.out.println("<output>");
String[] nodeTypeString = new String[]{ "", "ELEMENT", "ATTRIBUTE",
"TEXT_NODE", "CDATA_SECTION",
"ENTITY_REFERENCE", "ENTITY",
"PROCESSING_INSTRUCTION",
"COMMENT", "DOCUMENT",
"DOCUMENT_TYPE",
"DOCUMENT_FRAGMENT", "NOTATION" };
Node n;
while ((n = nl.nextNode()) != null) {
// System.out.println("<node" + ++i + " nodeType=\"" + nodeTypeString[n.getNodeType()] + "\">");
// serializer.transform(new DOMSource(n), new StreamResult(System.out));
// System.out.println("</node" + i + ">");
// System.out.println();