This abstract class represents a node in a document. A node is the basic object described by the Document Object Model for XML. A node can be an element, an element’s attributes, the DOCTYPE declaration, a comment, or the entire document itself. Nodes are ordered in a hierarchical tree in which child, parent, and sibling relationships are “known” by each node.

The XmlNode class is the parent object of the specific node type classes. The properties of this class expose the intrinsic values of the node: NamespaceURI, NodeType, parent, child, sibling nodes, etc. The methods allow a node to add to or remove from a node tree (in the context of an XmlDocument or XmlDocumentFragment), with respect to a reference node.

public abstract class XmlNode : ICloneable, IEnumerable, System.Xml.XPath.IXPathNavigable {
// Public Instance Properties
   public virtual field XmlAttributeCollection Attributes{get; } 
   public virtual field string BaseURI{get; } 
   public virtual field XmlNodeList ChildNodes{get; } 
   public virtual field XmlNode FirstChild{get; } 
   public virtual field bool HasChildNodes{get; } 
   public virtual field string InnerText{set; get; } 
   public virtual field string InnerXml{set; get; } 
   public virtual field bool IsReadOnly{get; } 
   public virtual field XmlNode LastChild{get; } 
   public abstract field string LocalName{get; } 
   public abstract field string Name{get; } 
   public virtual field string NamespaceURI{get; } 
   public virtual field XmlNode NextSibling{get; } public abstract ...

Get C# in a Nutshell now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.