Here you can find the source of getDocumentBuilder()
public static DocumentBuilder getDocumentBuilder() throws Exception
//package com.java2s; /*--------------------------------------------------------------- * Copyright 2005 by the Radiological Society of North America * * This source software is released under the terms of the * RSNA Public License (http://mirc.rsna.org/rsnapubliclicense) *----------------------------------------------------------------*/ import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; public class Main { /**/*from w ww . jav a2 s. c o m*/ * Get a DocumentBuilder that is namespace aware. * @return a namespace-aware DocumentBuilder. */ public static DocumentBuilder getDocumentBuilder() throws Exception { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware(true); return dbf.newDocumentBuilder(); } }