text2xml = sXML => {
  if (sXML.includes('<svg:svg')) {
    sXML = sXML.replace(/<(\/?)svg:/g, '<$1').replace('xmlns:svg', 'xmlns')
  }

  let out
  let dXML
  try {
    dXML = new DOMParser()
    dXML.async = false
  } catch (e) {
    throw new Error('XML Parser could not be instantiated')
  }
  try {
    out = dXML.parseFromString(sXML, 'text/xml')
  } catch (e2) {
    throw new Error('Error parsing XML string')
  }
  return out
}
Cross-browser compatible method of converting a string to an XML tree.
Found this function [here]{@link http://groups.google.com/group/jquery-dev/browse_thread/thread/c6d11387c580a77f}.
@function module:utilities.text2xml
@param {string} sXML
@throws {Error}
@returns {XMLDocument}