title: Locking a XML file during reading and writing in ASP.NET
body: <p>I have quite a bit of users accessing the same XML file.  Is the code below the best way to access the file?  If not, what is preferred?  I don't want the user to get a "file in use error" or something to that nature.</p>
  
  <pre><code>private readonly XDocument _xmlDocument;
  
  public SubCategoriesParser(string filePath)
  {
      if (filePath != null)
          _xmlDocument = XDocument.Load(filePath);
  }
  </code></pre>