You can use Response Filters (HttpFilter) and modify content on the fly, basically after response is formed, before EndRequest your filter is called (it's a stream descendant) and you can modify it as you wish. In the HttpModule, Init method you got to install HttpFilter (Response.Filter) and it will be called for that request.
Here is a good article :
http://aspnetresources.com/articles/HttpFilters
UPDATE:
Maybe this is a case of XY Problem, and you can solve your problem with simple server control that will render these custom tags properly.