public List <LocationData> GetLocation() { XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(HttpContext.Current.Server.MapPath("../../Data/Locations.xml")); List <LocationData> data = new List <LocationData>(); foreach (XmlNode LocationNode in xmlDoc.SelectNodes("Locations/location")) { string Code = LocationNode.SelectSingleNode("Code").InnerText; string Name = LocationNode.SelectSingleNode("Name").InnerText; data.Add(new LocationData(Code, Name)); } return(data); }