var xmldata = '' + '' + 'Content & stuff' + '' + '' + 'Second child' + '' + '' + 'Third child' + '' + ''; print('=== input xml data') print(xmldata); print('=== parsing') var doc = new XmlDocument(xmldata) print(typeof doc); print('=== pretty printed') print(doc) print('=== loop over "foo" children') doc.eachChild(function (x) { print(Duktape.enc('jx', x)); print(x); });