Scoped XMLDocument2 - createElementWithTextValue(String name, String value)

Creates and adds an element node with a text child node to the current node.

Table 1. Parameters
Name Type Description
name String Name of the element to be added.
value String The added element's text value.
Table 2. Returns
Type Description
XMLNode The current node.
var xmlString = "<test>" +
                "  <one>" +
                "    <two att=\"xxx\">abcd1234</two>" +
                "    <three boo=\"yah\" att=\"yyy\">1234abcd</three>" +
                "    <two>another</two>" +
                "  </one>" +
                "  <number>1234</number>" +
var xmlDoc = new XMLDocument2();
xmlDoc.createElement("new", "test");;
<?xml version="1.0" encoding="UTF-8"?>
            <two att="xxx">abcd1234</two>    
            <three att="yyy" boo="yah">1234abcd</three>