Here you can find the source of newXPath()
public static XPath newXPath()
//package com.java2s; import javax.xml.xpath.XPath; import javax.xml.xpath.XPathFactory; public class Main { private static XPathFactory xPathFactory; /**/*www . java 2 s.com*/ * Create an XPath instance using JVM defaults. */ public static XPath newXPath() { return xPathFactory.newXPath(); } }