XPathHelper { public String getString(String pathExpr, Node node) { try { return xPath.evaluate(pathExpr, node); } catch (XPathExpressionException e) { throw new IllegalArgumentException("XPath '" + pathExpr + "' invalid.", e); } } XPathHelper(XPath xPath); String getString(String pathExpr, Node node); NodeList getNodeList(String pathExpr, Node node); Node getNode(String pathExpr, Node node);  }
@Test public void testGetString() throws Exception { assertEquals("C", xPathHelper.getString("/xml/secondTag/valueTag", xmlDoc)); }