---
Product: Aspose.Cells
Platform: cpp
Page Type: reference
Canonical URL: https://reference.aspose.org/cells/cpp/xmldocument
---

# XmlDocument

## Overview

`XmlDocument` is a class in Aspose.Cells FOSS for C++.

Represents a parsed XML document.

This class declares 5 methods for XmlDocument objects in C++ programs.
Available methods include: `Build`, `GetRoot`, `IsNull`, `Load`, `SaveToUtf8`.
Public members are accessible to any C++ application after installing the Aspose.Cells FOSS for C++ package.

## Methods

| Signature | Description |
|-----------|-------------|
| `IsNull()` → `bool` | Returns true if null is set. |
| `Load(data: std::vector<uint8_t>)` → `XmlDocument` | Parses XML from UTF-8 bytes, preserving whitespace. |
| `Build(root: XmlElement)` → `XmlDocument` | Builds an XML document with the given root element and optional declaration. |
| `GetRoot()` → `XmlElement` | Gets the root element. |
| `SaveToUtf8()` → `std::vector<uint8_t>` | Serializes this document to UTF-8 encoded XML bytes (XML declaration + root element). |

## See Also

- [Aspose.Cells — Enterprise API Reference](https://reference.aspose.com/cells/)