Export (0) Print
Expand All

XmlDocument.DocumentElement Property

Gets the root XmlElement for the document.

Namespace:  System.Xml
Assembly:  System.Xml (in System.Xml.dll)

member DocumentElement : XmlElement with get

Property Value

Type: System.Xml.XmlElement
The XmlElement that represents the root of the XML document tree. If no root exists, a null reference (Nothing in Visual Basic) is returned.

The following example displays the root element of the XML document.

No code example is currently available or this language may not be supported.

Output:

<book genre="novel" ISBN="1-861001-57-5"><title>Pride And Prejudice</title></book> 

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

XNA Framework

Supported in: 3.0, 2.0, 1.0
Show:
© 2015 Microsoft