protected void chardata (String text)
            throws IOException
        {
            int l = text.length ();
            for (int i = 0; i < l; i++)
            {
                char c = text.charAt (i);
                switch (c)
                {
                case '<':
                    write(LESS_THAN_ENTITY);
                    break;
                case '>':
                    write(GREATER_THAN_ENTITY);
                    break;
                case '&':
                    write(AMPERSAND_ENTITY);
                    break;
                default:
                    write(c);
                }
            }
        }