XmlNode Methods

AppendChild

public virtual XmlNode AppendChild (XmlNode newChild);

Adds the specified node to the end of the list of child nodes.

Remarks

If the node already has a parent, it is first removed from that parent.

CloneNode

public virtual XmlNode CloneNode (bool deep);

Creates a duplicate of this node.

Remarks

When deep is true, the method recursively clones the subtree under the node.

GetNamespaceOfPrefix

public virtual string GetNamespaceOfPrefix (string prefix);

Returns the namespace URI associated with the given prefix.

InsertBefore

public virtual XmlNode InsertBefore (XmlNode newChild, XmlNode refChild);

Inserts the specified node before the specified reference node.

Remarks

If refChild is null, the new node is appended to the end.

RemoveChild

public virtual XmlNode RemoveChild (XmlNode oldChild);

Removes the specified child node from the list of children.

SelectNodes

public virtual XmlNodeList SelectNodes (string xpath);

Selects a list of nodes matching an XPath expression.

Remarks

Uses the current node as the context for the XPath query.

SelectSingleNode

public virtual XmlNode SelectSingleNode (string xpath);

Selects the first node that matches the XPath expression.

WriteContentTo

public virtual void WriteContentTo (XmlWriter w);

Writes the markup representing the child nodes of this node to the specified XmlWriter.

WriteTo

public virtual void WriteTo (XmlWriter w);

Writes the markup of this node, including its children, to the specified XmlWriter.