title: Overwrite existing XML file if it alreadly exists
body: <p>I am trying to overwrite an existing xml file if it already exists.</p>
  
  <p>I am using the code below to check if the file exists and then overwrite it if it does.  The existing file is hidden so I am unhiding it before attempting to overwrite. </p>
  
  <p>The changes are not occuring to the file and the overwriting is not working however. </p>
  
  <p>Here is the code I am using below minus the part where I am writing the new xml data.</p>
  
  <pre><code>if(File.Exists(filePath))
  {
       File.SetAttributes(filePath,FileAttributes.Normal);
       FileIOPermission filePermission = 
                new FileIOPermission(FileIOPermissionAccess.AllAccess,filePath);
  
       FileStream fs = new FileStream(filePath, FileMode.Create);
  
       XmlWriter w = XmlWriter.Create(fs);
   }
  </code></pre>