/**
  * Unmarshall a DOMElement object corresponding to a QTI sectionPart element.
  * 
  * @param DOMElement $element A DOMElement object.
  * @return QtiComponent A SectionPart object.
  * @throws UnmarshallingException
  */
 protected function unmarshall(DOMElement $element)
 {
     if (($identifier = static::getDOMElementAttributeAs($element, 'identifier')) !== null) {
         $object = new SectionPart($identifier);
         if (($required = static::getDOMElementAttributeAs($element, 'required', 'boolean')) !== null) {
             $object->setRequired($required);
         }
         if (($fixed = static::getDOMElementAttributeAs($element, 'fixed', 'boolean')) !== null) {
             $object->setFixed($fixed);
         }
         $preConditionElts = self::getChildElementsByTagName($element, 'preCondition');
         if (count($preConditionElts) > 0) {
             $preConditions = new PreConditionCollection();
             for ($i = 0; $i < count($preConditionElts); $i++) {
                 $marshaller = $this->getMarshallerFactory()->createMarshaller($preConditionElts[$i]);
                 $preConditions[] = $marshaller->unmarshall($preConditionElts[$i]);
             }
             $object->setPreConditions($preConditions);
         }
         $branchRuleElts = self::getChildElementsByTagName($element, 'branchRule');
         if (count($branchRuleElts) > 0) {
             $branchRules = new BranchRuleCollection();
             for ($i = 0; $i < count($branchRuleElts); $i++) {
                 $marshaller = $this->getMarshallerFactory()->createMarshaller($branchRuleElts[$i]);
                 $branchRules[] = $marshaller->unmarshall($branchRuleElts[$i]);
             }
             $object->setBranchRules($branchRules);
         }
         $itemSessionControlElts = self::getChildElementsByTagName($element, 'itemSessionControl');
         if (count($itemSessionControlElts) == 1) {
             $marshaller = $this->getMarshallerFactory()->createMarshaller($itemSessionControlElts[0]);
             $object->setItemSessionControl($marshaller->unmarshall($itemSessionControlElts[0]));
         }
         $timeLimitsElts = self::getChildElementsByTagName($element, 'timeLimits');
         if (count($timeLimitsElts) == 1) {
             $marshaller = $this->getMarshallerFactory()->createMarshaller($timeLimitsElts[0]);
             $object->setTimeLimits($marshaller->unmarshall($timeLimitsElts[0]));
         }
         return $object;
     } else {
         $msg = "The mandatory attribute 'identifier' is missing from element '" . $element->localName . "'.";
         throw new UnmarshallingException($msg, $element);
     }
 }