I am using XmlSeriazlier to deserialize xml file.
var serializer = new XmlSerializer(typeof(T));
using (var reader = document.CreateReader())
var result = (T)serializer.Deserialize(reader);
Xml can contain elements with different casing. Sample
<Layers>
<Layer name="something" />
<Layer name="anything" />
<layer name="nothing" /> ====> 'l' instead of 'L'
</Layers>
Now my class is like this.
public class Layers
{
[XmlElement("Layer")]
public List<Layer> Layers { get; set; }
}
Now this will not read 'layer' from the xml. How I can read all xml elements and save them in one list.