LeanDanaerto
New Member
Basically I have the xml file format likes:\[code\]<?xml version="1.0" encoding="utf-8" ?><retentions> <client id="1544"> <facility id="5436"> <retention period="23" /> </facility> </client> <client id="7353"> <facility id="3450"> <retention period="3" /> </facility> </client></retentions>\[/code\]I want to get all values of all attributes such as "1554", "5436", "23" etc.Please use XDocument instead of XMLDocument.My code is wrong:\[code\]XDocument XDoc = XDocument.Load("my.xml"); IEnumerable<XElement> results = (from el in XDoc.Root.Elements("retentions") select el);\[/code\]