Java tutorial
//package com.java2s; //License from project: Open Source License import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import org.w3c.dom.Document; public class Main { /** * create new DOM document * @return empty DOM object * @throws ParserConfigurationException in case of error */ public static Document createDocument() throws ParserConfigurationException { return DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument(); } }