Here you can find the source of getDocumentBuilder()
private static DocumentBuilder getDocumentBuilder()
//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 { private static DocumentBuilder getDocumentBuilder() { try {//from ww w .j av a 2 s. co m return getDocumentBuilderFactory().newDocumentBuilder(); } catch (ParserConfigurationException e) { throw new IllegalStateException("Could not create DocumentBuilder", e); } } private static DocumentBuilderFactory getDocumentBuilderFactory() { final DocumentBuilderFactory toReturn = DocumentBuilderFactory.newInstance(); toReturn.setNamespaceAware(true); return toReturn; } }