public static NodeList selectNodeList(Document document, String xPathExpression) throws TransformerException {
        XObject xObject = XPathAPI.eval(document, xPathExpression, getPrefixResolver(document));
        return xObject.nodelist();
    }
@Test
    public void testSelectNodeList() throws ParserConfigurationException, SAXException, IOException, TidyException, TransformerException {
        String responseData = "<book><page>one</page><page>two</page><empty></empty><a><b></b></a></book>";
        Document testDoc = XPathUtil.makeDocument(
                new ByteArrayInputStream(responseData.getBytes(StandardCharsets.UTF_8)), false, false, false, false,
                false, false, false, false, false);
        String xpathquery = "/book/page";
        NodeList nodeList = XPathUtil.selectNodeList(testDoc, xpathquery);
        assertEquals(2, nodeList.getLength());
        Element e0 = (Element) nodeList.item(0);
        Element e1 = (Element) nodeList.item(1);
        assertEquals("one", e0.getTextContent());
        assertEquals("two", e1.getTextContent());
    }