At several places in WS native stack there is an ineffective implementation of the normalize() method. The places are:
I spent several hours trying to optimize the method since there is a massive use of it and it is a performance bottleneck. The result is attached to this JIRA. It brings at least 25% performance gain.
IMHO, there should be a separate class for that and this class should be used from all places. Similar issue is in JBoss Common project (see the linked issue), which seems to be the most suitable place for the fixed class/method.