transformToDocument

The transformToDocument() method of the XSLTProcessor interface transforms the provided Node source to a Document using the XSLT stylesheet associated with XSLTProcessor.

MDN Reference