'Returns the XModule corresponding to this descriptor. Expects that the system
already supports all of the attributes needed by xmodules'

@property
def _xmodule(self):

    if (self.xmodule_runtime is None):
        raise UndefinedContext()
    assert (self.xmodule_runtime.error_descriptor_class is not None)
    if (self.xmodule_runtime.xmodule_instance is None):
        try:
            self.xmodule_runtime.construct_xblock_from_class(self.module_class, descriptor=self, scope_ids=self.scope_ids, field_data=self._field_data, for_parent=(self.get_parent() if self.has_cached_parent else None))
            self.xmodule_runtime.xmodule_instance.save()
        except Exception:
            self.xmodule_runtime.xmodule_instance = None
            if isinstance(self, self.xmodule_runtime.error_descriptor_class):
                log.exception('Error    creating    an    ErrorModule    from    an    ErrorDescriptor')
                raise
            log.exception('Error    creating    xmodule')
            descriptor = self.xmodule_runtime.error_descriptor_class.from_descriptor(self, error_msg=exc_info_to_str(sys.exc_info()))
            descriptor.xmodule_runtime = self.xmodule_runtime
            self.xmodule_runtime.xmodule_instance = descriptor._xmodule
    return self.xmodule_runtime.xmodule_instance
