/**
  * @param  \SimpleXMLElement $xml
  * @return BpostOnAppointment
  * @throws BpostXmlInvalidItemException
  */
 public static function createFromXML(\SimpleXMLElement $xml)
 {
     $self = new self();
     if (!isset($xml->bpostOnAppointment)) {
         throw new BpostXmlInvalidItemException();
     }
     $bpostOnAppointmentXml = $xml->bpostOnAppointment;
     if (isset($bpostOnAppointmentXml->receiver)) {
         $self->setReceiver(Receiver::createFromXML($bpostOnAppointmentXml->receiver->children('http://schema.post.be/shm/deepintegration/v3/common')));
     }
     if (isset($bpostOnAppointmentXml->inNetworkCutOff) && $bpostOnAppointmentXml->inNetworkCutOff != '') {
         $self->setInNetworkCutOff((string) $bpostOnAppointmentXml->inNetworkCutOff);
     }
     return $self;
 }