public Document createDocument() throws ParserConfigurationException {
  if (documentBuilder == null) {
    documentBuilder=documentBuilderFactory.newDocumentBuilder();
  }
  return documentBuilder.newDocument();
}

public Document createDocument ( ) throws ParserConfigurationException { if ( documentBuilder == null ) { documentBuilder = documentBuilderFactory . newDocumentBuilder ( ) ; } return documentBuilder . newDocument ( ) ; }
creates a new empty document .
