Are you passing XlangPart to a helper class?
(note: there's an important update relevant to this post, you should read it here)
Generally I'm not a big fan of manipulating messages in code (as many people will testify after having long discussions with me on the subject); however - reality often comes into play and I find myself being able to clearly justify it.
This is uaully the case when the complexity of the operations required is such that it would be very difficult (and so less maintainable) or much slower to do so in a map (using custom xsl or not).
Then, of course, there are all the other cases where you simply need to pass in a message part to a helper method for other reasons as well, not necessariliy to modify them.
In any case - I've recently stumbled accross this article that suggests passing around message parts may cause a reference leak.
Bottom line is that one should always pass in the xlang message and resolve the part in code rather than pass in the xlang part itself.
Just though it's worth sharing...