I don't believe you can necessarily do this given that writing to the output stream may result in the data being flushed to the client prior to any servlet filters being invoked post-population. As iftrue suggests, a different architecture would be advisable, to generate your XML (say) and then regenerate in whatever output format you desire.
EDIT: Having read your response to iftrue's posting, if you really can't interfere with the current processing, perhaps you require a servlet to proxy your request, capture the output from the original output, and then munge as appropriate. Very nasty, however :-(