Here you can find the source of newXPath()
public static XPath newXPath()
//package com.java2s; //License from project: Open Source License import javax.xml.xpath.XPath; import javax.xml.xpath.XPathFactory; public class Main { public static XPath newXPath() { XPathFactory factory = XPathFactory.newInstance(); XPath xpath = factory.newXPath(); return xpath; }/* www .j a va 2 s.co m*/ }