@classmethod
def for_element(cls, element):
    """ Returns an existing class or creates one for the given element.
        Returns a tuple with the class and a bool indicating creation.
        """
    assert element.represents_class
    class_name = element.name_if_class()
    if class_name in cls.known:
        return cls.known[class_name], False
    klass = cls(element)
    cls.known[class_name] = klass
    return klass, True
