$(document).ready(function () { $.ajax({ type: "GET", url: "https://mysafeinfo.com/api/data?list=presidents&format=xml&rows=5&sort=id desc", dataType: "xml", success: function (result) { $("#xml").text((new XMLSerializer()).serializeToString(result)); }, error: function (msg) { alert("fetch failed"); } }); });
<div id="xml"></div>