XElement xmlTree = new XElement("Root",
new XAttribute("Att1", "content1"),
new XAttribute("Att2", "content2"),
new XElement("Child1",
new XAttribute("Att1", "content3"),
new XAttribute("Att2", "content4")
),
new XElement("Child2",
new XAttribute("Att1", "content5"),
new XAttribute("Att2", "content6")
)
);
IEnumerable<XAttribute> attList = from att in xmlTree.Elements().Attributes("Att1")
select att;
foreach (XAttribute att in attList)
Console.WriteLine(att);