code: public static DomDocument getEmptyDocument(DocumentBuilderFactory documentBuilderFactory) {
      try {
        DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
        return new DomDocumentImpl(documentBuilder.newDocument());
      } catch (ParserConfigurationException e) {
        throw new ModelParseException("Unable to create a new document", e);
      }
    }
docs: Get an empty DOM document
  
  @param documentBuilderFactory the factory to build to DOM document
  @return the new empty document
  @throws ModelParseException if unable to create a new document