public GetSearchMatches() { try { XDocument objDoc = XDocument.Load(@"C:\Users\ahmed.khalifa\source\repos\LocationSuggestion\LocationSuggestion\" + "CharsSuggestionConfigurations.xml"); foreach (var Char in objDoc.Descendants("Char")) { CharItem charItem = new CharItem(); charItem.chars = Char.Element("CharList").Value.Split(',').ToList(); charItem.position = Char.Element("Position").Value; charItems.Add(charItem); } MaxResult = int.Parse(objDoc.Descendants("MaxResults").First().Value.ToString()); ResultsAccuracyPercentage = int.Parse(objDoc.Descendants("AccuracyPercentage").First().Value.ToString()); ResultsFilterType = objDoc.Descendants("ResultsFilterType").First().Value.ToString(); } catch (Exception ex) { } }