def get_namespace(label):
    """
    returns the namespace of an etree element or None, if the element
    doesn't have that attribute.
    """
    if 'namespace' in label.attrib:
        return label.attrib['namespace']
    else:
        return None