Java tutorial
//package com.java2s; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import org.w3c.dom.Document; public class Main { /** * Creates and returns a newly created {@link Document}-object. This is * quite usual start {@link PersistenceHandler #save(ExerciseData) save()} * -method of an {@link PersistenceHandler}-implementor. * * @return newly created empty {@link Document}-object * @throws ParserConfigurationException */ public static Document createEmptyDocument() throws ParserConfigurationException { DocumentBuilder dBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); Document doc = dBuilder.newDocument(); return doc; } }