'Returns this entity\'s name, or None if it doesn\'t have one.'

def name(self):

    elems = self.__reference.path().element_list()
    if (elems and elems[(-1)].has_name() and elems[(-1)].name()):
        return elems[(-1)].name().decode('utf-8')
    else:
        return None
