I have the following xml file
1 Computer Infor
var xml = XDocument.Parse(xmlDataString); var categoryElement = xml.Root .Elements("category") .FirstOrDefault(e => (string)e.Element("id") == "1");