protected function marshall(QtiComponent $component)
    {
        $element = parent::marshall($component);
        $baseType = $component->getBaseType();

        if ($component->getCorrectResponse() !== null) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($component->getCorrectResponse(), array($baseType));
            $element->appendChild($marshaller->marshall($component->getCorrectResponse()));
        }

        if ($component->getMapping() !== null) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($component->getMapping(), array($baseType));
            $element->appendChild($marshaller->marshall($component->getMapping()));
        }

        if ($component->getAreaMapping() !== null) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($component->getAreaMapping());
            $element->appendChild($marshaller->marshall($component->getAreaMapping()));
        }

        return $element;
    }