public static boolean isLegalXmlCharacter(int value) {
        return value == 0x9 || value == 0xA || value == 0xD || (value >= 0x20 && value <= 0xD7FF)
                || (value >= 0xE000 && value <= 0xFFFD) || (value >= 0x10000 && value <= 0x10FFFF);
    }
Verifies if the codepoint value represents a valid character as defined in paragraph 2.2 of
"Extensible Markup Language (XML) 1.0 (Fifth Edition)"

@param value
           the codepoint
@return {@code true} if the codepoint is a valid character per XML 1.0 definition, {@code false} otherwise.

@see <a href="https://www.w3.org/TR/2008/REC-xml-20081126/#NT-Char">Definition of a characters range</a>
xmppserver/src/main/java/org/jivesoftware/openfire/nio/XMLLightweightParser.java