javascript中接收到的响应不是XML,而在浏览器上显示XML

javascript中接收到的响应不是XML,而在浏览器上显示XML,javascript,xml,rest,Javascript,Xml,Rest,我不熟悉javascript和REST服务。我正在尝试从url获取一些数据。我编写的javascript代码如下所示:- var请求=新的XMLHttpRequest; request.openGET,https://findtest.akamai.com/_api/search/query?querytext=%27Agora%27&sourceid=%2782cdf98b-cc8b-48c3-a706-d88c1333cc4b%27和QueryTemplateProperties URL=

我不熟悉javascript和REST服务。我正在尝试从url获取一些数据。我编写的javascript代码如下所示:-

var请求=新的XMLHttpRequest; request.openGET,https://findtest.akamai.com/_api/search/query?querytext=%27Agora%27&sourceid=%2782cdf98b-cc8b-48c3-a706-d88c1333cc4b%27和QueryTemplateProperties URL=%27spfile://webroot/queryparametertemplate.xml%27&rowlimit=60&selectproperties=%27Title,作者,Url,日期%27&StartRow=%270%27&trimduplicates=%27true%27,false; 请求发送; var xml=request.responseText; document.writexml;
请记住,在编写HTML页面时,您编写的是HTML,而不是纯文本。谢谢克劳德。对我有用。
document.body.appendChild(document.createTextNode(xml));