public static Document createDocument(){
  try {
    DocumentBuilder builder=createDocumentBuilder();
    return builder.newDocument();
  }
 catch (  IOException e) {
    return null;
  }
}

public static Document createDocument ( ) { try { DocumentBuilder builder = createDocumentBuilder ( ) ; return builder . newDocument ( ) ; } catch ( IOException e ) { return null ; } }
creates a new , empty document .
