def valid_xml_char_ordinal(c):
    """
    Check if a character is valid in xml.
    :param c: Input character.
    :return: True or False.
    """
    codepoint = ord(c)
    # conditions ordered by presumed frequency
    return (
        0x20 <= codepoint <= 0xD7FF or
        codepoint in (0x9, 0xA, 0xD) or
        0xE000 <= codepoint <= 0xFFFD or
        0x10000 <= codepoint <= 0x10FFFF
        )