## XmlSerializer::Serialize(System::SharedPtr\<IO::Stream\>, System::SharedPtr\<Object\>) method


Serializes document into XML.

```cpp
void System::Xml::Serialization::XmlSerializer::Serialize(System::SharedPtr<IO::Stream> stream, System::SharedPtr<Object> o)
```


| Parameter | Type | Description |
| --- | --- | --- |
| stream | System::SharedPtr\<IO::Stream\> | Destination stream. |
| o | System::SharedPtr\<Object\> | [Object](../../../system/object/) to serialize. |

## See Also

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


Serializes document into XML.

```cpp
void System::Xml::Serialization::XmlSerializer::Serialize(System::SharedPtr<IO::TextWriter> textWriter, System::SharedPtr<Object> o)
```


| Parameter | Type | Description |
| --- | --- | --- |
| textWriter | System::SharedPtr\<IO::TextWriter\> | Destination stream. |
| o | System::SharedPtr\<Object\> | [Object](../../../system/object/) to serialize. |

## See Also

* Typedef [SharedPtr](../../../system/sharedptr/)
* Class [TextWriter](../../../system.io/textwriter/)
* Class [Object](../../../system/object/)
* Class [XmlSerializer](../)
* Namespace [System::Xml::Serialization](../../)
* Library [Aspose.PUB for C++](../../../)
## XmlSerializer::Serialize(System::SharedPtr\<XmlWriter\>, System::SharedPtr\<Object\>) method


Serializes document into XML.

```cpp
void System::Xml::Serialization::XmlSerializer::Serialize(System::SharedPtr<XmlWriter> xmlWriter, System::SharedPtr<Object> o)
```


| Parameter | Type | Description |
| --- | --- | --- |
| xmlWriter | System::SharedPtr\<XmlWriter\> | Destination stream. |
| o | System::SharedPtr\<Object\> | [Object](../../../system/object/) to serialize. |

## See Also

* Typedef [SharedPtr](../../../system/sharedptr/)
* Class [XmlWriter](../../../system.xml/xmlwriter/)
* Class [Object](../../../system/object/)
* Class [XmlSerializer](../)
* Namespace [System::Xml::Serialization](../../)
* Library [Aspose.PUB for C++](../../../)
## XmlSerializer::Serialize(System::SharedPtr\<IO::Stream\>, System::SharedPtr\<Object\>, System::SharedPtr\<XmlSerializerNamespaces\>) method


Serializes document into XML.

```cpp
void System::Xml::Serialization::XmlSerializer::Serialize(System::SharedPtr<IO::Stream> stream, System::SharedPtr<Object> o, System::SharedPtr<XmlSerializerNamespaces> namespaces)
```


| Parameter | Type | Description |
| --- | --- | --- |
| stream | System::SharedPtr\<IO::Stream\> | Destination stream. |
| o | System::SharedPtr\<Object\> | [Object](../../../system/object/) to serialize. |
| namespaces | System::SharedPtr\<XmlSerializerNamespaces\> | Namespace storage. |

## See Also

* Typedef [SharedPtr](../../../system/sharedptr/)
* Class [Stream](../../../system.io/stream/)
* Class [Object](../../../system/object/)
* Class [XmlSerializerNamespaces](../../xmlserializernamespaces/)
* Class [XmlSerializer](../)
* Namespace [System::Xml::Serialization](../../)
* Library [Aspose.PUB for C++](../../../)
## XmlSerializer::Serialize(System::SharedPtr\<IO::TextWriter\>, System::SharedPtr\<Object\>, System::SharedPtr\<XmlSerializerNamespaces\>) method


Serializes document into XML.

```cpp
void System::Xml::Serialization::XmlSerializer::Serialize(System::SharedPtr<IO::TextWriter> textWriter, System::SharedPtr<Object> o, System::SharedPtr<XmlSerializerNamespaces> namespaces)
```


| Parameter | Type | Description |
| --- | --- | --- |
| textWriter | System::SharedPtr\<IO::TextWriter\> | Destination stream. |
| o | System::SharedPtr\<Object\> | [Object](../../../system/object/) to serialize. |
| namespaces | System::SharedPtr\<XmlSerializerNamespaces\> | Namespace storage. |

## See Also

* Typedef [SharedPtr](../../../system/sharedptr/)
* Class [TextWriter](../../../system.io/textwriter/)
* Class [Object](../../../system/object/)
* Class [XmlSerializerNamespaces](../../xmlserializernamespaces/)
* Class [XmlSerializer](../)
* Namespace [System::Xml::Serialization](../../)
* Library [Aspose.PUB for C++](../../../)
## XmlSerializer::Serialize(System::SharedPtr\<XmlWriter\>, System::SharedPtr\<Object\>, System::SharedPtr\<XmlSerializerNamespaces\>) method


Serializes document into XML.

```cpp
void System::Xml::Serialization::XmlSerializer::Serialize(System::SharedPtr<XmlWriter> xmlWriter, System::SharedPtr<Object> o, System::SharedPtr<XmlSerializerNamespaces> namespaces)
```


| Parameter | Type | Description |
| --- | --- | --- |
| xmlWriter | System::SharedPtr\<XmlWriter\> | Destination stream. |
| o | System::SharedPtr\<Object\> | [Object](../../../system/object/) to serialize. |
| namespaces | System::SharedPtr\<XmlSerializerNamespaces\> | Namespace storage. |

## See Also

* Typedef [SharedPtr](../../../system/sharedptr/)
* Class [XmlWriter](../../../system.xml/xmlwriter/)
* Class [Object](../../../system/object/)
* Class [XmlSerializerNamespaces](../../xmlserializernamespaces/)
* Class [XmlSerializer](../)
* Namespace [System::Xml::Serialization](../../)
* Library [Aspose.PUB for C++](../../../)
## XmlSerializer::Serialize(System::SharedPtr\<XmlWriter\>, System::SharedPtr\<Object\>, System::SharedPtr\<XmlSerializerNamespaces\>, String) method


Serializes document into XML.

```cpp
void System::Xml::Serialization::XmlSerializer::Serialize(System::SharedPtr<XmlWriter> xmlWriter, System::SharedPtr<Object> o, System::SharedPtr<XmlSerializerNamespaces> namespaces, String encodingStyle)
```


| Parameter | Type | Description |
| --- | --- | --- |
| xmlWriter | System::SharedPtr\<XmlWriter\> | Destination stream. |
| o | System::SharedPtr\<Object\> | [Object](../../../system/object/) to serialize. |
| namespaces | System::SharedPtr\<XmlSerializerNamespaces\> | Namespace storage. |
| encodingStyle | String | Style to use while serializing object. |

## See Also

* Typedef [SharedPtr](../../../system/sharedptr/)
* Class [XmlWriter](../../../system.xml/xmlwriter/)
* Class [Object](../../../system/object/)
* Class [XmlSerializerNamespaces](../../xmlserializernamespaces/)
* Class [String](../../../system/string/)
* Class [XmlSerializer](../)
* Namespace [System::Xml::Serialization](../../)
* Library [Aspose.PUB for C++](../../../)
## XmlSerializer::Serialize(System::SharedPtr\<XmlWriter\>, System::SharedPtr\<Object\>, System::SharedPtr\<XmlSerializerNamespaces\>, String, String) method


Serializes document into XML.

```cpp
void System::Xml::Serialization::XmlSerializer::Serialize(System::SharedPtr<XmlWriter> xmlWriter, System::SharedPtr<Object> o, System::SharedPtr<XmlSerializerNamespaces> namespaces, String encodingStyle, String id)
```


| Parameter | Type | Description |
| --- | --- | --- |
| xmlWriter | System::SharedPtr\<XmlWriter\> | Destination stream. |
| o | System::SharedPtr\<Object\> | [Object](../../../system/object/) to serialize. |
| namespaces | System::SharedPtr\<XmlSerializerNamespaces\> | Namespace storage. |
| encodingStyle | String | Style to use while serializing object. |
| id | String | [Object](../../../system/object/) id to use while serializing it. |

## See Also

* Typedef [SharedPtr](../../../system/sharedptr/)
* Class [XmlWriter](../../../system.xml/xmlwriter/)
* Class [Object](../../../system/object/)
* Class [XmlSerializerNamespaces](../../xmlserializernamespaces/)
* Class [String](../../../system/string/)
* Class [XmlSerializer](../)
* Namespace [System::Xml::Serialization](../../)
* Library [Aspose.PUB for C++](../../../)
