public static void putValuesForXPathInList(Document document,
            String xPathQuery,
            List<? super String> matchStrings, boolean fragment) throws TransformerException {
        putValuesForXPathInList(document, xPathQuery, matchStrings, fragment, -1);
    }
@Test
    public void testPutValuesForXPathInList()
            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";
        List<String> matchs=new ArrayList<>();
        XPathUtil.putValuesForXPathInList(testDoc, xpathquery, matchs, true);
        assertEquals("<page>one</page>", matchs.get(0));
        assertEquals("<page>two</page>", matchs.get(1));
        matchs=new ArrayList<>();
        XPathUtil.putValuesForXPathInList(testDoc, xpathquery, matchs, false);
        assertEquals(2, matchs.size());
        assertEquals("one", matchs.get(0));
        assertEquals("two", matchs.get(1));
        matchs=new ArrayList<>();
        XPathUtil.putValuesForXPathInList(testDoc, "/book/a", matchs, false);
        assertEquals(1, matchs.size());
        assertNull(matchs.get(0));
    }