I have method which should save list of objects into xml file

```
 private void DumpToXMLFile(List<Url> 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();                
            }
        }

```

I;m getting this expcetion:

> 
> An unhandled exception of type 'System.InvalidOperationException'
>  occurred in ...
> 
> 
> 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.
> 
> 
> 

Tried with ConformanceLevel.Fragment but than I'm getting exception that I should use ConformanceLevel.Auto if I want to save xml file.