result.getResource(3).getContent().toString());
result.getResource(3).getContent().toString());   result = queryResource(service, "numbers.xml", "/test/node()[2]", 1); assertXMLEqual("<item id='2'><price>7.4</price><stock>43</stock></item>", result.getResource(0).getContent().toString()); result = queryResource(service, "numbers.xml", "/test/element()[2]", 1); assertXMLEqual("<item id='2'><price>7.4</price><stock>43</stock></item>", result.getResource(0).getContent().toString());   result = queryResource(service, "numbers.xml", "('test', 'pass')[2]", 1); assertEquals(result.getResource(0).getContent().toString(), "pass"); result = queryResource(service, "numbers.xml", "let $credentials := ('test', 'pass') let $user := $credentials[1] return $user", 1); assertEquals(result.getResource(0).getContent().toString(), "test"); result = queryResource(service, "numbers.xml", "let $credentials := ('test', 'pass') let $user := $credentials[2] return $user", 1); assertEquals(result.getResource(0).getContent().toString(), "pass");
    public void testPredicates() throws Exception {        String numbers =            "<test>"                + "<item id='1' type='alphanum'><price>5.6</price><stock>22</stock></item>"                + "<item id='2'><price>7.4</price><stock>43</stock></item>"                + "<item id='3'><price>18.4</price><stock>5</stock></item>"                + "<item id='4'><price>65.54</price><stock>16</stock></item>"                + "</test>";        try {            XQueryService service =                 storeXMLStringAndGetQueryService("numbers.xml", numbers);            service.setProperty(OutputKeys.INDENT, "no");            ResourceSet result = queryResource(service, "numbers.xml", "/test/item[2]/price/text()", 1);            assertEquals("7.4", result.getResource(0).getContent().toString());                        result = queryResource(service, "numbers.xml", "/test/item[5]", 0);                        result = queryResource(service, "numbers.xml", "/test/item[@id='4'][1]/price[1]/text()", 1);            assertEquals("65.54",                    result.getResource(0).getContent().toString());                        result = queryResource(service, "numbers.xml", "for $i in //item return " +                    "<item>{$i/price, $i/stock}</item>", 4);            assertXMLEqual("<item><price>5.6</price><stock>22</stock></item>",                    result.getResource(0).getContent().toString());            assertXMLEqual("<item><price>65.54</price><stock>16</stock></item>",                    result.getResource(3).getContent().toString());                          } catch (XMLDBException e) {            fail(e.getMessage());        }    }