class XPathFinder {

	public NodeList query(String query) {
		try {
			XPathFactory factory = XPathFactory.newInstance();
			XPath xpath = factory.newXPath();
			XPathExpression expr = xpath.compile(query);
			NodeList result = (NodeList) expr.evaluate(doc,
					XPathConstants.NODESET);
			return result;
		} catch (XPathExpressionException e) {
			throw new RuntimeException(e);
		}
	}

}