def parse_text(elem):
    """Parse text from an element.

    >>> parse_text(ET.XML('<Property>Hello World</Property>'))
    'Hello World'
    >>> parse_text(ET.XML('<Property>True  </Property>'))
    True
    >>> parse_text(ET.XML('<Property>123</Property>'))
    123
    >>> print(parse_text(ET.XML('<Property />')))
    None
    """
    if elem.text is None:
        return None
    try:
        return int(elem.text)
    except ValueError:
        pass
    text = elem.text.strip()
    if text == 'True':
        return True
    if text == 'False':
        return False
    return elem.text