Here you can find the source of xpathEvalNodes(String expr, Object e)
public static NodeList xpathEvalNodes(String expr, Object e)
//package com.java2s; import javax.xml.namespace.QName; import javax.xml.xpath.XPath; import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathFactory; import org.w3c.dom.NodeList; public class Main { private final static XPath xpath = XPathFactory.newInstance().newXPath(); public static NodeList xpathEvalNodes(String expr, Object e) { return (NodeList) xpathEval(expr, e, XPathConstants.NODESET); }/*ww w . ja v a2s.c om*/ public static Object xpathEval(String expr, Object e, QName type) { try { return xpath.evaluate(expr, e, type); } catch (Exception exc) { throw new RuntimeException("Cannot evaluate xpath expression.", exc); } } }