XElement.Attribute returns the XAttribute of this XElement that has the specified XName.
using System;
using System.Linq;
using System.Xml.Linq;
using System.Collections;
using System.Collections.Generic;
publicclass MainClass{
publicstaticvoid Main(){
XElement xmlTree = new XElement("Root",
new XAttribute("Att", "attribute content")
);
XAttribute att = xmlTree.Attribute("Att");
Console.WriteLine(att);
}
}