/**
  * @param boolean $returnSXE
  * @param \SimpleXMLElement $sxe
  * @return string|\SimpleXMLElement
  */
 public function xmlSerialize($returnSXE = false, $sxe = null)
 {
     if (null === $sxe) {
         $sxe = new \SimpleXMLElement('<EpisodeOfCare xmlns="http://hl7.org/fhir"></EpisodeOfCare>');
     }
     parent::xmlSerialize(true, $sxe);
     if (0 < count($this->identifier)) {
         foreach ($this->identifier as $identifier) {
             $identifier->xmlSerialize(true, $sxe->addChild('identifier'));
         }
     }
     if (null !== $this->status) {
         $this->status->xmlSerialize(true, $sxe->addChild('status'));
     }
     if (0 < count($this->statusHistory)) {
         foreach ($this->statusHistory as $statusHistory) {
             $statusHistory->xmlSerialize(true, $sxe->addChild('statusHistory'));
         }
     }
     if (0 < count($this->type)) {
         foreach ($this->type as $type) {
             $type->xmlSerialize(true, $sxe->addChild('type'));
         }
     }
     if (0 < count($this->condition)) {
         foreach ($this->condition as $condition) {
             $condition->xmlSerialize(true, $sxe->addChild('condition'));
         }
     }
     if (null !== $this->patient) {
         $this->patient->xmlSerialize(true, $sxe->addChild('patient'));
     }
     if (null !== $this->managingOrganization) {
         $this->managingOrganization->xmlSerialize(true, $sxe->addChild('managingOrganization'));
     }
     if (null !== $this->period) {
         $this->period->xmlSerialize(true, $sxe->addChild('period'));
     }
     if (0 < count($this->referralRequest)) {
         foreach ($this->referralRequest as $referralRequest) {
             $referralRequest->xmlSerialize(true, $sxe->addChild('referralRequest'));
         }
     }
     if (null !== $this->careManager) {
         $this->careManager->xmlSerialize(true, $sxe->addChild('careManager'));
     }
     if (0 < count($this->careTeam)) {
         foreach ($this->careTeam as $careTeam) {
             $careTeam->xmlSerialize(true, $sxe->addChild('careTeam'));
         }
     }
     if ($returnSXE) {
         return $sxe;
     }
     return $sxe->saveXML();
 }
 /**
  * @param boolean $returnSXE
  * @param \SimpleXMLElement $sxe
  * @return string|\SimpleXMLElement
  */
 public function xmlSerialize($returnSXE = false, $sxe = null)
 {
     if (null === $sxe) {
         $sxe = new \SimpleXMLElement('<EpisodeOfCareStatusHistory xmlns="http://hl7.org/fhir"></EpisodeOfCareStatusHistory>');
     }
     parent::xmlSerialize(true, $sxe);
     if (null !== $this->status) {
         $this->status->xmlSerialize(true, $sxe->addChild('status'));
     }
     if (null !== $this->period) {
         $this->period->xmlSerialize(true, $sxe->addChild('period'));
     }
     if ($returnSXE) {
         return $sxe;
     }
     return $sxe->saveXML();
 }