<PackageReference Include="System.Xml.XDocument" Version="4.0.11-beta-23409" />

System.Xml.Linq.XObject

public abstract class XObject : IXmlLineInfo
Represents a node or an attribute in an XML tree.
public string BaseUri { get; }

Gets the base URI for this XObject.

public XDocument Document { get; }

Gets the XDocument for this XObject.

public abstract XmlNodeType NodeType { get; }

Gets the node type for this XObject.

public XElement Parent { get; }

Gets the parent XElement of this XObject.

Raised when this XObject or any of its descendants have changed.

Raised when this XObject or any of its descendants are about to change.

public void AddAnnotation(object annotation)

Adds an object to the annotation list of this XObject.

public object Annotation(Type type)

Gets the first annotation object of the specified type from this XObject.

public T Annotation<T>()

Get the first annotation object of the specified type from this XObject.

public IEnumerable<object> Annotations(Type type)

Gets a collection of annotations of the specified type for this XObject.

public IEnumerable<T> Annotations<T>()

Gets a collection of annotations of the specified type for this XObject.

public void RemoveAnnotations(Type type)

Removes the annotations of the specified type from this XObject.

public void RemoveAnnotations<T>()

Removes the annotations of the specified type from this XObject.