xml.elemNew()
Creates an XML document object element
xml.elemNew( namespace_or_childName=string, childName=string )
Returns: org.w3c.dom.Element
Examples
xml_document = XmlNew(); // new XML document to populate
xml_root = xml_document.elemNew("notes");
xml_document.XmlRoot = xml_root; // set the root node of the XML document
<span class="nv">xml_child</span> <span class="o">=</span> <span class="nf">xml_document.elemNew</span><span class="p">(</span><span class="s2">"note"</span><span class="p">);</span> <span class="c">// first child node</span>
<span class="nv">xml_secondary_child</span> <span class="o">=</span> <span class="nf">xml_document.elemNew</span><span class="p">(</span><span class="s2">"to"</span><span class="p">,</span> <span class="s2">"second_child"</span><span class="p">);</span> <span class="c">// child node for the first child node</span>
<span class="nf">xml_child.XmlChildren.append</span><span class="p">(</span><span class="nv">xml_secondary_child</span><span class="p">);</span>
<span class="nf">xml_root.XmlChildren.append</span><span class="p">(</span><span class="nv">xml_child</span><span class="p">);</span> <span class="c">// add the first child node to the XML document</span>
<span class="nf">writeDump</span><span class="p">(</span><span class="nv">xml_document</span><span class="p">);</span>