The LINQ to XML API provides the ability to associate a user data object with any class inheriting from the XObject class via annotations. This allows the application developer to assign whatever data type object he wants to an element, document, or any other object whose class is derived from the XObject class. The object could be additional keys for an element's data; it could be an object that will parse the element's contents into itself or whatever you need.
Adding Annotations with XObject.AddAnnotation()
Adding annotations is accomplished using the XObject.AddAnnotation method. Here is the prototype:
void XObject.AddAnnotation(object annotation);