# C1.Win.Xml.XmlDocumentExt.LoadFile

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Win_Xml_XmlDocumentExt_LoadFile_" data-uid="C1.Win.Xml.XmlDocumentExt.LoadFile*">LoadFile Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Win_Xml_XmlDocumentExt_LoadFile_" data-uid="C1.Win.Xml.XmlDocumentExt.LoadFile*"></a>
<h4 id="C1_Win_Xml_XmlDocumentExt_LoadFile_System_Xml_XmlDocument_System_String_System_Xml_XmlReaderSettings_" data-uid="C1.Win.Xml.XmlDocumentExt.LoadFile(System.Xml.XmlDocument,System.String,System.Xml.XmlReaderSettings)">LoadFile(XmlDocument, string, XmlReaderSettings)</h4>
<div class="markdown level1 summary"><p>Loads the XML document from the specified URL.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static void LoadFile(this XmlDocument document, string fileName, XmlReaderSettings settings = null)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Sub LoadFile(document As XmlDocument, fileName As String, Optional settings As XmlReaderSettings = Nothing)</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">XmlDocument</span></td>
      <td><span class="parametername">document</span></td>
      <td><p>The <span class="xref">System.Xml.XmlDocument</span> instance to populate with the XML data.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">fileName</span></td>
      <td><p>The path or URL of the XML file to load. The file must exist and contain well-formed XML.</p>
</td>
    </tr>
    <tr>
      <td><span class="xref">XmlReaderSettings</span></td>
      <td><span class="parametername">settings</span></td>
      <td><p>Optional <span class="xref">System.Xml.XmlReaderSettings</span> that specify how the XML is read, such as validation,
whitespace handling, or security settings. If <code>null</code>, the default settings are used.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
