I'm having difficulties in understanding the exact form of the entities - is it just my browser/setup or is something wrong with the formatting ?
would show about the various speedup suggestions.
If it would be true that the entities content might be separated by successively splitting on '>' and then on '<', replacing the content from the hash and re-joining the modified parts might even beat the regexp-based approach.
Curious.