code: public void endDiff() throws DiffException {
          DOMSource source = new DOMSource(doc);
          try {
          transformer.transform(source, result);
          } catch (TransformerException te) {
              throw new DiffException(te);
          }
      }
docs: End the diff.
  This closes the &lt;diff&gt; node.
  
  @throws DiffException when there is an underlying exception, e.g.
  writing to a file caused an IOException