解决方案
利用 blob对象 实现XML的写入
利用 a标签 实现XML的下载
blobOptions = blobOptions || {};
content= ("\n");
content= content +("\n");
content= content + ("");
var blob = new Blob([content], blobOptions);
var a = document.createElement('a');
a.innerHTML = fileName;
a.download = fileName;
a.href = URL.createObjectURL(blob);
document.body.appendChild(a);
var evt = document.createEvent("MouseEvents");
evt.initEvent("click", false, false);
a.dispatchEvent(evt);
document.body.removeChild(a);