You are here: Reference > JavaScript > client-side > HTML DOM > properties > XMLDocument (xml)

XMLDocument property (xml)

Browser support:
Returns a reference to the XMLDocument object that represents the contents of an xml element.
Note: The support for the XMLDocument property has been removed in Internet Explorer 9.
Internet Explorer allows the insertion of XML documents directly to a HTML document with the xml element. The XMLDocument property can be used to retrieve an XMLDocument object representing the embedded XML data island.


You can find the related objects in the Supported by objects section below.
This property is read-only.

Possible values:

Reference to a XMLDocument object.
Default: this property has no default value.

Example HTML code 1:

This example illustrates the use of the XMLDocument property:
    <script type="text/javascript">
        function DisplayXMLIsland () {
            var xmlIsland = document.getElementById ("xmlIsland");
            if (xmlIsland.XMLDocument) {
                alert (xmlIsland.XMLDocument.xml);
            else {
                alert ("Your browser doesn't support the XMLDocument property.");
    <xml id="xmlIsland">
            <name>Clark Kent</name>
    <button onclick="DisplayXMLIsland ()">Get the contents of the XML island</button>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content