Here you can find the source of getNewXmlDocument()
public static Document getNewXmlDocument()
//package com.java2s; /************************************************************* * This file is part of CB2XML. //from ww w.j ava2s . c o m * See the file "LICENSE" for copyright information and the * terms and conditions for copying, distribution and * modification of CB2XML. ************************************************************* */ import org.w3c.dom.Document; import javax.xml.parsers.DocumentBuilderFactory; public class Main { public static Document getNewXmlDocument() { try { return DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument(); } catch (Exception e) { e.printStackTrace(); return null; } } }