import re


def get_all_text(elem):
    """Returns all texts in the subtree of the lxml.etree._Element, which is
    returned by Document.cssselect() etc.
    """
    text = ''.join(elem.itertext())
    return re.sub(r'\s+', ' ', text).strip()