def getNamespace(element):
    """ Utility method to extract the namespace from an XML element tag encoded as {namespace}localname. """
    if element.tag[0] == '{':
        return element.tag[1:].split('}')[0]
    else:
        return ''
