I have created a web-based UTF-8 XML feed for use in an iPhone application.
When viewing in a web browser, if the feed contains a British Pound sign, I get a nasty X
As you've shown a PHP code snippet...
I had the same problem, but your sample xmlEntities($text) { ... } function above didn't work.
Changing to just htmlspecialchars() did work however - as (in my case) I only care about characters which would screw up the parsing of the XML document (<,> etc), everything else should be valid unicode ....