Here you can find the source of getXPathFactory()
public static synchronized XPathFactory getXPathFactory()
//package com.java2s; import javax.xml.xpath.XPathFactory; public class Main { private static XPathFactory xpathFactory; /**/*from w w w . j av a 2 s .c o m*/ * Gets the XPath factory, creating it if necessary. * * @return the XPath factory. */ public static synchronized XPathFactory getXPathFactory() { if (xpathFactory == null) { xpathFactory = XPathFactory.newInstance(); } return xpathFactory; } }