Parse the raw XML string as a boolean value.

def _parse_boolean(element_text, state):
    """Parse the raw XML string as a boolean value."""
    value = None

    lowered_text = element_text.lower()
    if lowered_text == 'true':
        value = True
    elif lowered_text == 'false':
        value = False
    else:
        state.raise_error(InvalidPrimitiveValue, 'Invalid boolean value "{}"'.format(element_text))

    return value