# C1.Schedule.BasePersistableObject.ToXml

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Schedule_BasePersistableObject_ToXml_" data-uid="C1.Schedule.BasePersistableObject.ToXml*">ToXml Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Schedule_BasePersistableObject_ToXml_" data-uid="C1.Schedule.BasePersistableObject.ToXml*"></a>
<h4 id="C1_Schedule_BasePersistableObject_ToXml_System_Xml_XmlWriter_" data-uid="C1.Schedule.BasePersistableObject.ToXml(System.Xml.XmlWriter)">ToXml(XmlWriter)</h4>
<div class="markdown level1 summary"><p>Saves an object to the specified <span class="xref">System.Xml.XmlWriter</span>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public virtual void ToXml(XmlWriter writer)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Overridable Sub ToXml(writer As XmlWriter)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><span class="xref">XmlWriter</span></td>
      <td><span class="parametername">writer</span></td>
      <td><p>The <span class="xref">System.Xml.XmlWriter</span> that will receive
the object data.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Schedule_BasePersistableObject_ToXml_" data-uid="C1.Schedule.BasePersistableObject.ToXml*"></a>
<h4 id="C1_Schedule_BasePersistableObject_ToXml_System_IO_Stream_" data-uid="C1.Schedule.BasePersistableObject.ToXml(System.IO.Stream)">ToXml(Stream)</h4>
<div class="markdown level1 summary"><p>Saves an object to the specified <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream">Stream</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void ToXml(Stream stream)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub ToXml(stream As Stream)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream">Stream</a></td>
      <td><span class="parametername">stream</span></td>
      <td><p>The <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream">Stream</a> that contains the object data.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
