Here you can find the source of createXPath()
public static XPath createXPath()
//package com.java2s; //License from project: Open Source License import javax.xml.xpath.*; public class Main { /**//from w w w. j a v a2 s. c o m * Creates an XPath object with a custom NamespaceContext given the Node to * operate on * <p/> * the Node or document to operate on. Note that namespace * handling will not work if a Node fragment is passed in * * @return a new XPath object */ public static XPath createXPath() { return XPathFactory.newInstance().newXPath(); } }