/Users/kevin/cumulus/node_modules/pivotal/index.js:913
val = sanitize(data[d].toString()).entityEncode();
^
TypeError: undefined is not a function
at Object.pivotal.toXml (/Users/kevin/cumulus/node_modules/pivotal/index.js:913:27)
at Object.pivotal.toXml (/Users/kevin/cumulus/node_modules/pivotal/index.js:911:32)
The reason seems that Entity encoding is no longer in validator.js since version 3: https://github.com/chriso/validator.js#deprecations