code: public static Document createEmptyDocument() {
          Document output = null;
          try {
              final DocumentBuilder db = FACTORY.newDocumentBuilder();
              db.setErrorHandler(new ParserErrorHandler());
              output = db.newDocument();
          } catch (final Exception ex) {
              LOGGER.error("Problem creating empty XML document.", ex);
          }
  
          return output;
      }
docs: Create an empty XML structure.
  
  @return An empty DOM tree.