Node to use as the root of the DOM tree or subtree for which to construct an XML representation.
A string containing the XML representation of the specified DOM tree.
Thrown if the tree could not be successfully serialized, probably due to issues with the content's compatibility with XML serialization.
Thrown if a serialization of HTML was requested but could not succeed due to the content not being well-formed.
The following types are also permitted as descendants of the root node, in addition to
If any other type is encountered, a
TypeError exception is thrown.
There are some things worth noting about the XML output by
Attrnodes are always serialized with their
namespaceURIintact. This may mean that a previously-specified
prefixor default namespace may be dropped or altered.
"<someelement></someelement>") instead of using the empty-element tag (
|Chrome||Edge||Firefox||Internet Explorer||Opera||Safari||WebView Android||Chrome Android||Firefox for Android||Opera Android||Safari on IOS||Samsung Internet|
© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.