/**
  * @param boolean $returnSXE
  * @param \SimpleXMLElement $sxe
  * @return string|\SimpleXMLElement
  */
 public function xmlSerialize($returnSXE = false, $sxe = null)
 {
     if (null === $sxe) {
         $sxe = new \SimpleXMLElement('<Bundle xmlns="http://hl7.org/fhir"></Bundle>');
     }
     parent::xmlSerialize(true, $sxe);
     if (null !== $this->type) {
         $this->type->xmlSerialize(true, $sxe->addChild('type'));
     }
     if (null !== $this->total) {
         $this->total->xmlSerialize(true, $sxe->addChild('total'));
     }
     if (0 < count($this->link)) {
         foreach ($this->link as $link) {
             $link->xmlSerialize(true, $sxe->addChild('link'));
         }
     }
     if (0 < count($this->entry)) {
         foreach ($this->entry as $entry) {
             $entry->xmlSerialize(true, $sxe->addChild('entry'));
         }
     }
     if (null !== $this->signature) {
         $this->signature->xmlSerialize(true, $sxe->addChild('signature'));
     }
     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('<Parameters xmlns="http://hl7.org/fhir"></Parameters>');
     }
     parent::xmlSerialize(true, $sxe);
     if (0 < count($this->parameter)) {
         foreach ($this->parameter as $parameter) {
             $parameter->xmlSerialize(true, $sxe->addChild('parameter'));
         }
     }
     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('<DomainResource xmlns="http://hl7.org/fhir"></DomainResource>');
     }
     parent::xmlSerialize(true, $sxe);
     if (null !== $this->text) {
         $this->text->xmlSerialize(true, $sxe->addChild('text'));
     }
     if (0 < count($this->contained)) {
         foreach ($this->contained as $contained) {
             $contained->xmlSerialize(true, $sxe->addChild('contained'));
         }
     }
     if (0 < count($this->extension)) {
         foreach ($this->extension as $extension) {
             $extension->xmlSerialize(true, $sxe->addChild('extension'));
         }
     }
     if (0 < count($this->modifierExtension)) {
         foreach ($this->modifierExtension as $modifierExtension) {
             $modifierExtension->xmlSerialize(true, $sxe->addChild('modifierExtension'));
         }
     }
     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('<Binary xmlns="http://hl7.org/fhir"></Binary>');
     }
     parent::xmlSerialize(true, $sxe);
     if (null !== $this->contentType) {
         $this->contentType->xmlSerialize(true, $sxe->addChild('contentType'));
     }
     if (null !== $this->content) {
         $this->content->xmlSerialize(true, $sxe->addChild('content'));
     }
     if ($returnSXE) {
         return $sxe;
     }
     return $sxe->saveXML();
 }