Java tutorial
//package com.java2s; import org.xml.sax.InputSource; import javax.xml.xpath.*; public class Main { private static XPath xPath; public static String getResultXpathstring(String expr, InputSource inputSource) throws XPathExpressionException { XPathExpression xExpr = xPath.compile(expr); return xExpr.evaluate(inputSource); } }