code: public Document transformToDocument() {
          DOMResult r = new DOMResult();
          transformTo(r);
          return (Document) r.getNode();
      }
docs: Convenience method that returns the result of the
  transformation as a Document.
  
  @exception IllegalArgumentException if source is null
  @exception ConfigurationException if the TraX system isn't
  configured properly
  @exception XMLUnitException if the transformation throws an
  exception