That's problematic. Anything other than a browser that needs to read the XML is going to be confused by the presence of an HTML script element.
I don't even want to know what would happen if you tried this trick with an RSS feed or XML sitemap. Google itself would probably reject it as invalid.
I'd much rather they replace it with an HTTP response header that nominates a WebAssembly preprocessor program.