Use actual doc in xmlTextReaderRead*Xml Otherwise the encoding of the document is ignored and non-ASCII characters are serialized as numeric references even if the encoding is specified as UTF-8.