private string ExtractValue(XElement xe, string elementName) { IEnumerable<XElement> tmp = xe.Descendants(elementName); XElement targetElement = tmp.FirstOrDefault(); return targetElement != null ? targetElement.Value : string.Empty; }