How to access a specific attribute using LINQ to XML
问题 I wish to access some specific attribute (Tag name) i an XML file, and place them in a list but i cant get i right. What am I doing wrong?? The list should look like this: Tag_1 Tag_2 Tag_3 Code: XElement xelement = XElement.Load("C:/...../Desktop/Testxml.xml"); var tagNames = from tag in xelement.Elements("tagGroup") select tag.Attribute("name").Value; foreach (XElement xEle in tagNames) { //.... } Here is the XML file: <configuration> <logGroup> <group name="cpm Log 1h 1y Avg" logInterval="