System.Xml.XmlNode.AppendChild Method

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

Syntax

public virtual XmlNode AppendChild (XmlNode newChild)

Parameters

newChild
The node to add. All the contents of the node to be added are moved into the specified location.

Returns

The node added.

Remarks

If the newChild is already in the tree, it is removed from its original position and added to its target position. For more information about inserting nodes, see Inserting Nodes into an XML Document.

If the node being inserted was created from another document, you can use XmlDocument.ImportNode(XmlNode, bool) to import the node to the current document. The imported node can then be inserted into the current document.

Requirements

Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0