This document is archived and information here might be outdated.  Recommended version.


IXMLWriter.WriteTo Method (ArcObjects .NET 10.6 SDK)
ArcObjects Library Reference (System)  

IXMLWriter.WriteTo Method

Specifies output XML stream.

[Visual Basic .NET]
Public Sub WriteTo ( _
    ByVal outputStream As IStream _
)
[C#]
public void WriteTo (
    IStream outputStream
);
[C++]
HRESULT WriteTo(
  IStream* outputStream
);
[C++]

Parameters outputStream [in]
outputStream is a parameter of type IStream*

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Remarks


The WriteTo method specifies the output XML stream. XMLStream lets you write/read (in our case write) xml data to stream object.

For Example:

Dim pWriter As IXMLWriter
Set pWriter=New XMLWriter

Dim pXMLStream as IXMLStream
Set pXMLStream=new XMLStream

'*** This sets output to XML Stream ***
pWriter.WriteTo pStream

'*** Write some xml to the stream ***
pWriter.WriteXMLDeclaration

'*** Save stream to the file ***
pXMLStream.SaveToFile App.Path & "\new.xml"

See Also

IXMLWriter Interface

.NET Snippets

Serialize an XML File