The XML declaration is not serialized, try the code:
let doc = new window.DOMParser().parseFromString('<?xml version="1.0" encoding="utf-8" standalone="yes"?><a>Ahoy</a>', 'application/xml');
console.log(new window.XMLSerializer().serializeToString(doc));
Chrome output: <?xml version="1.0" encoding="utf-8" standalone="yes"?><a>Ahoy</a>
jsdom 15.1.1, w3c-xmlserializer 1.1.2 output: <a>Ahoy</a>
The XML declaration is not serialized, try the code:
Chrome output:
<?xml version="1.0" encoding="utf-8" standalone="yes"?><a>Ahoy</a>jsdom 15.1.1, w3c-xmlserializer 1.1.2 output:
<a>Ahoy</a>