This method appends the specified string to existing string data.
XML:
<capitals>
<capital>Beijing</capital>
<capital>Berlin</capital>
<capital>London</capital>
<capital>Paris</capital>
<capital>Washington</capital>
</capitals>
JavaScript:
xml_doc = new ActiveXObject("Microsoft.XMLDOM");
xml_doc.async = false;
xml_doc.load("capitals.xml");
text = xml_doc.documentElement.lastChild.firstChild;
text.appendData(" DC");
document.write(text.data);
Washington DC
In this example using the 'capitals.xml' file, the code appends the characters ' DC' to the text of the last 'capital' element (Washington).