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 dBuilder; /**//ww w . j a v a2s . c o m * Return a new empty XML document, using the default JVM XML API * usually this is Xerces. */ public static Document newDocument() { return dBuilder.newDocument(); } }