I added a couple options (and tests) for xml2json.js that I needed and that others may find useful:
a textNodeKey option to override the default $t -- because I need to generate JSON that I can feed into mongodb. mongodb does not like '$' in JSON key names. When not specified, the textNodeKey option defaults to '$t'
an attributes option to specify whether or not the xml's nodes' attributes are converted to the JSON. The default is attributes: true which preserves the usual behavior of allowing attributes into the generated JSON.
options.textNodeKey specifies the json key for a node's text data. if…
… unspecified, defaults to usual $t.
options.attributes specifies whether or not xml nodes' attributes are…
… generated in the json. if unspecified, defaults to , preserving the usual behavior of generating json that includes the node's attributes
2 years old -- surely stale by now.