Xmlnode_Object.AddElement Method

Creates a new XML element and appends it as a child of the current tree node.
xmlnode_object.AddElement(element, value)

Prerequisites

The current node must be of type "element" or "document".

Parameters

element

A required String expression that specifies the name of the element to be created.

value

An optional String expression that specifies the value of the element to be created.

Remarks

This is a convenience method that creates, initializes, and links a node to add an element to a DOM tree. The new element appears as the new last child of xmlnode_object.

Examples

Dim doc As XmlDoc 
Dim root As XmlNode
doc = New XmlDoc("my_doc")
root = doc.DocumentElement
root.AddElement("section1", "Data for section 1")

See Also

XML Classes | xmldoc_object.CreateNode | xmlnode_object.AddAttribute | xmlnode_object.SetElement