Here you can find the source of newDocumentBuilder()
public static DocumentBuilder newDocumentBuilder()
//package com.java2s; //License from project: Apache License import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; public class Main { public static DocumentBuilder newDocumentBuilder() { return newDocumentBuilder(true); }//from w w w .j a va 2 s. c om public static DocumentBuilder newDocumentBuilder(boolean validating) { try { DocumentBuilderFactory dbfac = DocumentBuilderFactory.newInstance(); dbfac.setNamespaceAware(true); dbfac.setValidating(validating); return dbfac.newDocumentBuilder(); } catch (ParserConfigurationException e) { throw new RuntimeException(e); } } }