private void writeXmlEsc(int ch)
{
Charset.Encoder enc = m_charsetEncoder;
string hex = "0123456789abcdef";
enc.encode('&', this);
enc.encode('#', this);
enc.encode('x', this);
if (ch > 0xff)
{
enc.encode(hex[(ch >> 12) & 0xf], this);
enc.encode(hex[(ch >> 8) & 0xf], this);
}
enc.encode(hex[(ch >> 4) & 0xf], this);
enc.encode(hex[(ch >> 0) & 0xf], this);
enc.encode(';', this);
}