title: saving xml file and ConformanceLevel
body: <p>I have method which should save list of objects into xml file</p>
  
  <pre><code> private void DumpToXMLFile(List&lt;Url&gt; urls, string fileName)
          {
              XmlWriterSettings settings = new XmlWriterSettings();
              settings.Indent = true;
              settings.OmitXmlDeclaration = true;
              settings.NewLineOnAttributes = true;
              settings.ConformanceLevel = ConformanceLevel.Auto;
  
              using (XmlWriter writer = XmlWriter.Create(fileName, settings))
              {
                  writer.WriteStartDocument();
                  writer.WriteStartElement("Countries");
                  foreach (var url in urls)
                  {
                      writer.WriteStartElement("Country");
                          writer.WriteElementString("Name", url.Name);                        
                          writer.WriteElementString("Url", url.Uri);
                      writer.WriteEndElement();
                  }
                  writer.WriteEndElement();
                  writer.WriteEndElement();                
              }
          }
  </code></pre>
  
  <p>I;m getting this expcetion:</p>
  
  <blockquote>
    <p>An unhandled exception of type 'System.InvalidOperationException'
    occurred in ...</p>
    
    <p>Additional information: Token EndElement in state EndRootElement would
    result in an invalid XML document. Make sure that the ConformanceLevel
    setting is set to ConformanceLevel.Fragment or ConformanceLevel.Auto
    if you want to write an XML fragment.</p>
  </blockquote>
  
  <p>Tried with ConformanceLevel.Fragment but than I'm getting exception that I should use ConformanceLevel.Auto if I want to save xml file.</p>