// Create XML structure
var languagesObj = {@code JavaScriptPython};
// set the document
resources.LANGUAGES_XML.setDocument("languages", languagesObj.toXMLString());
Example 2: (shows XML String)
// Create XML structure
var languagesString = {@code var languages = "JavaScriptPython";};
// set the document
resources.LANGUAGES_XML.setDocument("languages", languagesString);
Further documentation.
Example 1: (shows XML object)
Example 2: (shows XML String)