Helper functions to deal with XML data structures and metadata in node.js