docx-validate
    Preparing search index...

    Function serializeXml

    • Serialize a DOM Document (or any Node) back to a string.

      encoding is accepted for parity with Python's doc.toxml(encoding=...) and is currently advisory: @xmldom always emits UTF-16 JS strings and leaves byte-encoding to the caller (write the result with fs.writeFile(..., 'utf8') unless you have a reason to do otherwise). When encoding is supplied we prepend an XML declaration that names it, like Python does — and when the document already carries a declaration, its encoding pseudo-attribute is rewritten to name the requested encoding, since the returned string is what the caller will store or re-parse as that encoding.

      Parameters

      • node: Node
      • Optionalencoding: string

      Returns string