XML elements often nest, have data in attributes and/or as character data. The way to capture this data is by using ,attr and ,chardata respectively for those cases.
var doc = `
<parent>
<child1 attr1="attribute one"/>
<child2>and some cdata</child2>
</p...