toXml = str => {
  // &apos; is ok in XML, but not HTML
  // &gt; does not normally need escaping, though it can if within a CDATA expression (and preceded by "]]")
  return str
    .replace(/&/g, '&amp;')
    .replace(/</g, '&lt;')
    .replace(/>/g, '&gt;')
    .replace(/"/g, '&quot;')
    .replace(/'/g, '&#x27;') // Note: `&apos;` is XML only
}
Converts characters in a string to XML-friendly entities.
@function module:utilities.toXml
@example `&` becomes `&amp;`
@param {string} str - The string to be converted
@returns {string} The converted string