 <p>Implement a custom <code>XmlResolver</code> and use it for reading the XML. By default, the <code>XmlUrlResolver</code> is used, which automatically downloads the resolved references.</p> <pre><code>public class CustomResolver : XmlUrlResolver { public override object GetEntity(Uri absoluteUri, string role, Type ofObjectToReturn) { // base calls XmlUrlResolver.DownloadManager.GetStream(...) here } } </code></pre> <p>And use it like this:</p> <pre><code>var settings = new XmlReaderSettings { XmlResolver = new CustomResolver() }; var reader = XmlReader.Create(fileName, settings); var xDoc = XDocument.Load(reader); </code></pre>