convertor converts encodings using iconv extension. You can use it with streamed data (XML).
To be honest, this is quite complex. If you need just general character set conversion, not streams, take a look at iconv or recode itself.
The former version 1.1 does not depend on iconv and conversion is based on the hard coded conv tables. It supports unicode entities as well.