DOMParser in Worker

I did a little test and it looks like HTMLRewriter does appear to work with XML, so I think this should work by abstracing my existing code to work with either DOMParser or HTMLRewriter (I guess by collectiong all the things that might be useful the serializer).

I don’t think this use-case really fits within HTMLRewriter, and I wonder if it actually provides any performance enhancements over using DOMParser since the whole response has to be read anyways. :confused:

Abstracting this code will actually result in a bit of waste for both the client and the edge because I’ll have to query for things that I’m going to throw away.