I am trying to parse a XML file in C# using Visual Studio and show the data in a ListBox, but I don\'t know how to parse it when I\'m dealing with a nested XML file.
XmlSerializer mySerializer = new XmlSerializer(typeof(Persons));
// Create a FileStream or textreader to read the xml data.
FileStream myFileStream = new FileStream("xmldatafile.xml", FileMode.Open);
var person = (Persons) mySerializer.Deserialize(myFileStream);
You also need to add constructor without parameter for Persons class.