protected function marshall(QtiComponent $component)
    {
        $element = static::getDOMCradle()->createElement($component->getQtiClassName());

        $fieldIdentifer = $component->getFieldIdentifier();
        $baseType = $component->getBaseType();

        self::setDOMElementValue($element, $component->getValue());

        if (!empty($fieldIdentifer)) {
            $this->setDOMElementAttribute($element, 'fieldIdentifier', $fieldIdentifer);
        }

        if ($component->isPartOfRecord() && $baseType >= 0) {
            $this->setDOMElementAttribute($element, 'baseType', BaseType::getNameByConstant($baseType));
        }

        return $element;
    }