in reply to converting unicode to numerical entities
This has been asked (and answered!) before: look at Re: Regex to encode entities in XML