But this whole problem is one that OCPsoft Rewrite (http://ocpsoft.org/rewrite/ – the core of PrettyFaces 4, to be released soon) is designed to solve. Much more control over the entire rewriting process.
Do you play Magic?
Get TopDecked MTG, the #1 Magic App, built by players, for players. Free to use, forever.