def METHOD_NAME(self, loop_characteristics):
    sequential = loop_characteristics.get('isSequential') == 'true'
    prefix = 'bpmn:multiInstanceLoopCharacteristics'
    cardinality = self.xpath(f'./{prefix}/bpmn:loopCardinality')
    cardinality = cardinality[0].text if len(cardinality) > 0 else None
    collection = self.attribute('collection', 'camunda', loop_characteristics)
    if cardinality is None and collection is None:
        self.raise_validation_exception('A multiinstance task must specify a cardinality or a collection')
    element_var = self.attribute('elementVariable', 'camunda', loop_characteristics)
    condition = self.xpath(f'./{prefix}/bpmn:completionCondition')
    condition = condition[0].text if len(condition) > 0 else None
    original = self.spec.task_specs.pop(self.task.name)
    # We won't include the data input, because sometimes it is the collection, and other times it
    # is the cardinality.  The old MI task evaluated the cardinality at run time and treated it like
    # a cardinality if it evaluated to an int, and as the data input if if evaluated to a collection
    # I highly doubt that this is the way Camunda worked then, and I know that's not how it works
    # now, and I think we should ultimately replace this with something that corresponds to how
    # Camunda actually handles things; however, for the time being, I am just going to try to 
    # replicate the old behavior as closely as possible.
    # In our subclassed MI task, we'll update the BPMN multiinstance attributes when the task starts.
    params = {
        'task_spec': '',
        'cardinality': cardinality, 
        'data_output': TaskDataReference(collection) if collection is not None else None,
        'output_item': TaskDataReference(element_var) if element_var is not None else None,
        'condition': condition,
    }
    if sequential:
        self.task = SequentialMultiInstanceTask(self.spec, original.name, **params)
    else:
        self.task = ParallelMultiInstanceTask(self.spec, original.name, **params)
    self._copy_task_attrs(original, loop_characteristics)