There's a bit of a sequencing issue there... DOM Level 2 expects the DocumentType node to be created first, then used to create the Document node. There is no way to change the doctype after the document node has been created. Unfortunately, DOMResult as currently architected presumes that the target Document has already been created and passed in, which leaves us no room to manuver.
To solve this we'd need a DOMResult that was initialized with a DOMImplementation and used that to create the DocumentType and Document. That approach isn't currently supported. It could be added...
