createDocument

fun createDocument(namespace: String?, qualifiedName: String?, doctype: DocumentType? = definedExternally): XMLDocument(source)

The createDocument() method of the DOMImplementation interface creates and returns an XMLDocument.

MDN Reference