## XmlDocument::get_DocumentElement method


Returns the root [XmlElement](../../xmlelement/) for the document.

```cpp
SharedPtr<XmlElement> System::Xml::XmlDocument::get_DocumentElement()
```


### ReturnValue

The [XmlElement](../../xmlelement/) that represents the root of the XML document tree. If no root exists, **nullptr** is returned.

## See Also

* Typedef [SharedPtr](../../../system/sharedptr/)
* Class [XmlElement](../../xmlelement/)
* Class [XmlDocument](../)
* Namespace [System::Xml](../../)
* Library [Aspose.PUB for C++](../../../)
