using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml; using System.Reflection; namespace XMLExtractor { public class Nota { public string indice { get; set; } public string valore { get; set; } public static List getNote (XmlNode attr){ List noteList = new List(); foreach (XmlNode row in attr.ChildNodes) { Nota nota = new Nota(); PropertyInfo propertyInfoNota = nota.GetType().GetProperty(row.FirstChild.Name); propertyInfoNota.SetValue(nota, Convert.ChangeType(row.InnerText, propertyInfoNota.PropertyType), null); noteList.Add(nota); } return noteList; } } }