protected function marshall(QtiComponent $component)
    {
        $element = parent::marshall($component);

        foreach ($component->getResponseDeclarations() as $responseDeclaration) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($responseDeclaration);
            $element->appendChild($marshaller->marshall($responseDeclaration));
        }

        foreach ($component->getOutcomeDeclarations() as $outcomeDeclaration) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($outcomeDeclaration);
            $element->appendChild($marshaller->marshall($outcomeDeclaration));
        }
        
        foreach ($component->getTemplateDeclarations() as $templateDeclaration) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($templateDeclaration);
            $element->appendChild($marshaller->marshall($templateDeclaration));
        }
        
        if ($component->hasTemplateProcessing() === true) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($component->getTemplateProcessing());
            $templProcElt = $marshaller->marshall($component->getTemplateProcessing());
            $element->appendChild($templProcElt);
        }
        
        if ($component->hasResponseProcessing() === true) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($component->getResponseProcessing());
            $respProcElt = $marshaller->marshall($component->getResponseProcessing());
            $element->appendChild($respProcElt);
        }
        
        foreach ($component->getModalFeedbackRules() as $modalFeedbackRule) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($modalFeedbackRule);
            $element->appendChild($marshaller->marshall($modalFeedbackRule));
        }
        
        foreach ($component->getShufflings() as $shuffling) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($shuffling);
            $element->appendChild($marshaller->marshall($shuffling));
        }
        
        foreach ($component->getResponseValidityConstraints() as $responseValidityConstraint) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($responseValidityConstraint);
            $element->appendChild($marshaller->marshall($responseValidityConstraint));
        }
        
        $this->setDOMElementAttribute($element, 'adaptive', $component->isAdaptive());
        $this->setDOMElementAttribute($element, 'timeDependent', $component->isTimeDependent());
        
        $endAttemptIdentifiers = $component->getEndAttemptIdentifiers();
        if (count($endAttemptIdentifiers) > 0) {
            $this->setDOMElementAttribute($element, 'endAttemptIdentifiers', implode("\x20", $endAttemptIdentifiers->getArrayCopy()));
        }

        return $element;
    }