As I previously mentioned, with the LINQ to XML API, attributes are implemented with the XAttribute class, and unlike the W3C XML DOM API, they do not inherit from a node. Therefore, they have no inheritance relationship with elements. However, in the LINQ to XML API, they are every bit as easy to work with as elements. Let's take a look.
Attributes are created just like elements and most other LINQ to XML classes. This topic is covered in the "Creating Attributes with XAttribute" section previously in this chapter.
Attributes can be traversed using the XElement.FirstAttribute, XElement.LastAttribute, XAttribute.NextAttribute, and XAttribute.PreviousAttribute properties and the XElement.Attribute ...