Convert XML to JSON
function(file) {
    var xml = file.contents;
    var xmlDoc = libxmljs.parseXml(xml);
    var rootNode = xmlDoc.root();

    var resourceObject = {};
    var valueNodes = rootNode.find("data");
    valueNodes.forEach(function(element) {
      var name = element.attr("name").value();
      var value = element.get("value").text();
      resourceObject[name] = value;
    });

    return JSON.stringify(resourceObject);
  }