def METHOD_NAME(self) -> str:
    """
    Return the real name for this element by looking by looking either to
    the name or ref attribute value.
    :raises SchemaValueError: when instance has no name/ref
        attribute.
    """
    name = getattr(self, "name", None) or getattr(self, "ref", None)
    if name:
        return text.suffix(name)
    raise SchemaValueError(f"Schema class `{self.class_name}` unknown real name.")