public static boolean isAllowedInXml(final int c) {
        boolean ok = false;
        if (c >= 0x10000 && c <= 0x10FFFF) {
            ok = true;
        } else if (c >= 0xE000 && c <= 0xFFFD) {
            ok = true;
        } else if (c >= 0x20 && c <= 0xD7FF) {
            ok = true;
        } else if (c == 0x9 || c == 0xA || c == 0xD) {
            ok = true;
        }
        return ok;
    }