Here you can find the source of getStringValueByXPath(Node node, String xPath)
public static String getStringValueByXPath(Node node, String xPath) throws XPathExpressionException
//package com.java2s; //License from project: Apache License import javax.xml.xpath.XPath; import javax.xml.xpath.XPathExpressionException; import javax.xml.xpath.XPathFactory; import org.w3c.dom.Node; public class Main { private static XPath path = XPathFactory.newInstance().newXPath(); public static String getStringValueByXPath(Node node, String xPath) throws XPathExpressionException { return path.evaluate(xPath, node); }// w w w . j a va 2 s . c om }