System.Xml.Linq.XElement
Represents an XML element. See XElement Class Overview and the Remarks section on this page for usage information and examples.To browse the .NET Framework source code for this type, see the Reference Source.
Gets an empty collection of elements.
Gets the first attribute of this element.
Gets a value indicating whether this element as at least one attribute.
Gets a value indicating whether this element has at least one child element.
Gets a value indicating whether this element contains no content.
Gets the last attribute of this element.
Gets or sets the name of this element.
Gets or sets the concatenated text contents of this element.
Initializes a new instance of the XElement class with the specified name.
Initializes a new instance of the XElement class with the specified name and content.
Initializes a new instance of the XElement class with the specified name and content.
Initializes a new instance of the XElement class from an XStreamingElement object.
public XElement()
Loads an XElement from a file.
Loads an XElement from a file, optionally preserving white space, setting the base URI, and retaining line information.
Creates a new XElement instance by using the specified stream.
Creates a new XElement instance by using the specified stream, optionally preserving white space, setting the base URI, and retaining line information.
Loads an XElement from a TextReader.
Loads an XElement from a TextReader, optionally preserving white space and retaining line information.
Loads an XElement from an XmlReader, optionally preserving white space, setting the base URI, and retaining line information.
Cast the value of this XAttribute to a DateTimeOffset.
Load an XElement from a string that contains XML.
Load an XElement from a string that contains XML, optionally preserving white space and retaining line information.
Returns a collection of elements that contain this element, and the ancestors of this element.
Returns a filtered collection of elements that contain this element, and the ancestors of this element. Only elements that have a matching XName are included in the collection.
Returns a collection of attributes of this element.
Returns a filtered collection of attributes of this element. Only elements that have a matching XName are included in the collection.
Returns a collection of nodes that contain this element, and all descendant nodes of this element, in document order.
Returns a collection of elements that contain this element, and all descendant elements of this element, in document order.
Returns a filtered collection of elements that contain this element, and all descendant elements of this element, in document order. Only elements that have a matching XName are included in the collection.
Gets the default XNamespace of this XElement.
Gets the namespace associated with a particular prefix for this XElement.
Gets the prefix associated with a namespace for this XElement.
Removes nodes and attributes from this XElement.
Removes the attributes of this XElement.
Replaces the child nodes and the attributes of this element with the specified content.
Replaces the child nodes and the attributes of this element with the specified content.
Replaces the attributes of this element with the specified content.
Replaces the attributes of this element with the specified content.
Serialize this element to a TextWriter.
Serialize this element to a TextWriter, optionally disabling formatting.
Serialize this element to an XmlWriter.
Sets the value of an attribute, adds an attribute, or removes an attribute.
Sets the value of a child element, adds a child element, or removes a child element.
Sets the value of this element.