Here you can find the source of newDocument()
public static Document newDocument()
//package com.java2s; import javax.xml.parsers.DocumentBuilder; import org.w3c.dom.Document; public class Main { private static DocumentBuilder documentBuilder = null; /**/*from w w w.jav a 2 s .com*/ * * @return */ public static Document newDocument() { if (documentBuilder == null) { return null; } return documentBuilder.newDocument(); } }