Send asynchronous browser requests with fetch, XMLHttpRequest, JSON, errors, and progressive UI.
Lessons
Parse XML responses with DOMParser.
Handling XML Responses is easiest to learn by reading the example, changing it, and observing the result.
const response = await fetch('/data/feed.xml');
const text = await response.text(); // raw string
const doc = new DOMParser().parseFromString(text, 'application/xml');
console.log(doc.querySelector('title').textContent);
// Other body readers:
// await response.blob(); // binary (images, files)
// await response.formData(); // multipart form dataPractice the Handling XML Responses example in a small scratch file, then explain what changed and why.