misha.korolcov, вы можете для разбора xml-документа использовать класс DOMParser...
<style>
details {
font: 1em system-ui;
max-width: 20em;
margin: 1em auto;
}
details > summary,details > a {
background: #607D8B;
color: white;
padding: 0.5em;
cursor: pointer;
border-radius: 5px;
}
details > a {
display: block;
width: max-content;
margin: 0.5em auto;
text-decoration: none;
}
</style>
<script>
async function getDataFromCnbc() {
const response = await fetch("https://corsproxy.glitch.me/https://www.cnbc.com/id/10000664/device/rss/rss.html");
const xml = await response.text();
const xmlDocument = new DOMParser().parseFromString(xml, "text/xml");
for(const node of xmlDocument.querySelectorAll("item")) {
const details = document.createElement("details");
const summary = document.createElement("summary");
summary.append(node.querySelector("title"));
const description = document.createElement("description");
description.innerHTML = node.querySelector("description").textContent;
const link = document.createElement("a");
link.href = node.querySelector("link").textContent;
link.textContent = "Read more";
details.append(summary, description, link);
document.body.append(details);
}
}
document.addEventListener("DOMContentLoaded", getDataFromCnbc);
</script>