System.Xml.XmlDocument.DocumentElement Property

Gets the root System.Xml.XmlElement for the document.

Syntax

public XmlElement DocumentElement { get; }

Value

an System.Xml.XmlElement object that represents the document element, or null if it does not exist yet.

Remarks

It represents the document element (root element) of this document. A well-formed XML document must have exactly one element, but this property could be null.

This property is an equivalent of "documentElement" attribute of Document interface in W3C Document Object Model Core specification.

Requirements

Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0