Here you can find the source of createDocument()
public static Document createDocument()
//package com.java2s; //License from project: Open Source License import org.w3c.dom.*; import javax.xml.parsers.*; public class Main { private static DocumentBuilder ourDocBuilder = null; /** Create an xml document */ public static Document createDocument() { Document doc = ourDocBuilder.newDocument(); return doc; }/*from w w w . ja v a 2 s . c o m*/ }