Here you can find the source of newDocumentBuilder()
public static DocumentBuilder newDocumentBuilder() throws ParserConfigurationException
//package com.java2s; //License from project: Open Source License import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; public class Main { public static DocumentBuilder newDocumentBuilder() throws ParserConfigurationException { return newDocumentBuilderFactory().newDocumentBuilder(); }// www .j a va 2s.c o m public static DocumentBuilderFactory newDocumentBuilderFactory() { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware(true); return dbf; } }