}
DocumentBuilder b = bf.newDocumentBuilder();
Document d = b.parse(tmpFile);
printSource(new DOMSource(d));
XPath xp = XPathFactory.newInstance().newXPath();
xp.setNamespaceContext(new SimpleNamespaceResolver("wadl", "http://wadl.dev.java.net/2009/02"));
// check base URI
String val = (String) xp.evaluate("/wadl:application/wadl:resources/@base", d, XPathConstants.STRING);
assertEquals(val, getBaseUri().toString());
// check total number of resources is 8
val = (String) xp.evaluate("count(//wadl:resource)", d, XPathConstants.STRING);
assertEquals("8", val);
val = (String) xp.evaluate("count(//wadl:resource[@path='all-extended'])", d, XPathConstants.STRING);
assertEquals("1", val);
val = (String) xp.evaluate("count(//wadl:resource[@path='resource'])", d, XPathConstants.STRING);
assertEquals("1", val);
val = (String) xp.evaluate("count(//wadl:resource[@path='application.wadl'])", d, XPathConstants.STRING);
assertEquals("1", val);
xp.setNamespaceContext(new SimpleNamespaceResolver("jersey", "http://jersey.java.net/"));
val = (String) xp.evaluate("count(//jersey:extended)", d, XPathConstants.STRING);
assertEquals("31", val);
}