fetch("https://codetogo.io/api/users.xml")
.then(response => response.text())
.then(data => {
const parser = new DOMParser();
const xml = parser.parseFromString(data, "application/xml");
console.log(xml);
})
.catch(console.error);
<users> <user> <id>1</id> <name>Alex</name> </user> <user> <id>2</id> <name>Sam</name> </user> </users>