## XmlDocument::Save(String) method


Saves the XML document to the specified file. If the specified file exists, this method overwrites it.

```cpp
virtual void System::Xml::XmlDocument::Save(String filename)
```


| Parameter | Type | Description |
| --- | --- | --- |
| filename | String | The location of the file where you want to save the document. |

## See Also

* Class [String](../../../system/string/)
* Class [XmlDocument](../)
* Namespace [System::Xml](../../)
* Library [Aspose.PUB for C++](../../../)
## XmlDocument::Save(SharedPtr\<IO::Stream\>) method


Saves the XML document to the specified stream.

```cpp
virtual void System::Xml::XmlDocument::Save(SharedPtr<IO::Stream> outStream)
```


| Parameter | Type | Description |
| --- | --- | --- |
| outStream | SharedPtr\<IO::Stream\> | The stream to which you want to save. |

## See Also

* Typedef [SharedPtr](../../../system/sharedptr/)
* Class [Stream](../../../system.io/stream/)
* Class [XmlDocument](../)
* Namespace [System::Xml](../../)
* Library [Aspose.PUB for C++](../../../)
## XmlDocument::Save(SharedPtr\<IO::TextWriter\>) method


Saves the XML document to the specified TextWriter.

```cpp
virtual void System::Xml::XmlDocument::Save(SharedPtr<IO::TextWriter> writer)
```


| Parameter | Type | Description |
| --- | --- | --- |
| writer | SharedPtr\<IO::TextWriter\> | The TextWriter to which you want to save. |

## See Also

* Typedef [SharedPtr](../../../system/sharedptr/)
* Class [TextWriter](../../../system.io/textwriter/)
* Class [XmlDocument](../)
* Namespace [System::Xml](../../)
* Library [Aspose.PUB for C++](../../../)
## XmlDocument::Save(SharedPtr\<XmlWriter\>) method


Saves the XML document to the specified [XmlWriter](../../xmlwriter/).

```cpp
virtual void System::Xml::XmlDocument::Save(SharedPtr<XmlWriter> w)
```


| Parameter | Type | Description |
| --- | --- | --- |
| w | SharedPtr\<XmlWriter\> | The [XmlWriter](../../xmlwriter/) to which you want to save. |

## See Also

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