/**
  * Marshall a PreCondition object into a DOMElement object.
  * 
  * @param QtiComponent $component A PreCondition object.
  * @return DOMElement The according DOMElement object.
  */
 protected function marshall(QtiComponent $component)
 {
     $element = static::getDOMCradle()->createElement($component->getQtiClassName());
     $marshaller = $this->getMarshallerFactory()->createMarshaller($component->getExpression());
     $element->appendChild($marshaller->marshall($component->getExpression()));
     return $element;
 }
 /**
  * @see \qtism\data\storage\xml\marshalling\RecursiveMarshaller::marshallChildrenKnown()
  */
 protected function marshallChildrenKnown(QtiComponent $component, array $elements)
 {
     $element = self::getDOMCradle()->createElement($component->getQtiClassName());
     if ($component instanceof ResponseIf || $component instanceof ResponseElseIf) {
         $marshaller = $this->getMarshallerFactory()->createMarshaller($component->getExpression());
         $element->appendChild($marshaller->marshall($component->getExpression()));
     }
     foreach ($elements as $elt) {
         $element->appendChild($elt);
     }
     return $element;
 }
 /**
  * Marshall a TemplateDefault object into a DOMElement object.
  * 
  * @param QtiComponent $component A TemplateDefault object.
  * @return DOMElement The according DOMElement object.
  */
 protected function marshall(QtiComponent $component)
 {
     $element = static::getDOMCradle()->createElement($component->getQtiClassName());
     self::setDOMElementAttribute($element, 'templateIdentifier', $component->getTemplateIdentifier());
     $expr = $component->getExpression();
     $exprMarshaller = $this->getMarshallerFactory()->createMarshaller($expr);
     $exprElt = $exprMarshaller->marshall($expr);
     $element->appendChild($exprElt);
     return $element;
 }