### Question:
StateXML { public static NodeList getChildNodes(Node rootNode, String xpath) throws XPathExpressionException { return (NodeList)newXPath().evaluate(xpath, rootNode, XPathConstants.NODESET); } private  StateXML(); static Node createChildNode(Node rootNode, Document doc, Node parent, String childPath, String childName); static Element createElement(Document doc, String qname); static Node getChildNode(Node rootNode, String childPath); static NodeList getChildNodes(Node rootNode, String xpath); static Node getChildStateNode(Node rootNode, String childPathFragment); static boolean anyMatch(Node rootNode, String xpath); static T getStateBean(Node node, String childPathFragment, Class<T> target); static XPath newXPath();  }### Answer:
@Test public void testGetChildNodes() throws ParserConfigurationException, XPathExpressionException { Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument(); Node parent = doc.appendChild(doc.createElement("parent")); NodeList child = StateXML.getChildNodes(parent, "/parent/child"); assertEquals(0, child.getLength()); Node expectedChild1 = parent.appendChild(doc.createElement("child")); Node expectedChild2 = parent.appendChild(doc.createElement("child")); child = StateXML.getChildNodes(parent, "/parent/child"); assertEquals(2, child.getLength()); assertEquals(expectedChild1, child.item(0)); assertEquals(expectedChild2, child.item(1)); }