public String toString(){
  StringBuilder sb=new StringBuilder();
  try {
    TransformerFactory tFactory=TransformerFactory.newInstance();
    Transformer transformer=tFactory.newTransformer();
    transformer.setOutputProperty(OutputKeys.INDENT,"yes");
    transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount","2");
    DOMSource source=new DOMSource(this.node);
    Path tempPath=Files.createTempDirectory(Paths.get(System.getProperty("java.io.tmpdir")),"IMFDocuments");
    File tempDir=tempPath.toFile();
    File outputFile=new File(tempDir + "/XMLDom.xml");
    StreamResult result=new StreamResult(outputFile);
    transformer.transform(source,result);
    sb.append(readFile(outputFile));
    outputFile.deleteOnExit();
  }
 catch (  TransformerException|IOException e) {
    imfErrorLogger.addError(IMFErrorLogger.IMFErrors.ErrorCodes.IMF_CPL_ERROR,IMFErrorLogger.IMFErrors.ErrorLevels.WARNING,e.getMessage());
  }
  return sb.toString();
}

public String toString ( ) { StringBuilder sb = new StringBuilder ( ) ; try { TransformerFactory tFactory = TransformerFactory . newInstance ( ) ; Transformer transformer = tFactory . newTransformer ( ) ; transformer . setOutputProperty ( OutputKeys . INDENT , "yes" ) ; transformer . setOutputProperty ( "{http://xml.apache.org/xslt}indent-amount" , "2" ) ; DOMSource source = new DOMSource ( this . node ) ; Path tempPath = Files . createTempDirectory ( Paths . get ( System . getProperty ( "java.io.tmpdir" ) ) , "IMFDocuments" ) ; File tempDir = tempPath . toFile ( ) ; File outputFile = new File ( tempDir + "/XMLDom.xml" ) ; StreamResult result = new StreamResult ( outputFile ) ; transformer . transform ( source , result ) ; sb . append ( readFile ( outputFile ) ) ; outputFile . deleteOnExit ( ) ; } catch ( TransformerException | IOException e ) { imfErrorLogger . addError ( IMFErrorLogger . IMFErrors . ErrorCodes . IMF_CPL_ERROR , IMFErrorLogger . IMFErrors . ErrorLevels . WARNING , e . getMessage ( ) ) ; } return sb . toString ( ) ; }
a method that returns a string representation of a domnodeobjectmodel object
