C# create read write XML file
Sample file <? xml version="1.0" encoding="utf-8" ?> < root > < property name = "One" > One </ property > < values > < value name = "Two" > Two </ value > < value name = "Three" > Three </ value > </ values > </ root > Creating/Writing XML file public void TestXMLWriter() { string filePath = @" c:\temp\sample.xml "; List< string > values = new List< string >(); values.Add(" Two "); values.Add(" Three "); XmlWriterSettings xmlSettings = new XmlWriterSettings(); xmlSettings.Indent = true ; xmlSettings.Encoding = Encoding.UTF8; using (XmlWriter writer = XmlWriter.Create( filePath, xmlSettings )) { writer.WriteStartDocument(); writer.WriteStartElement(" root "); { writer.WriteStartElement(" property "); writer.WriteAttributeSt