src/ClearSaleID/Entity/Request/Passenger.php
public function toXML( XMLWriter $XMLWriter )
    {
        $XMLWriter->startElement( 'Passageiro' );

        if ($this->name) {
            $XMLWriter->writeElement( 'Nome', $this->name );
        } else {
            throw new RequiredFieldException( 'Field Nome of the Passenger object is required' );
        }

        if ($this->frequentFlyerCard) {
            $XMLWriter->writeElement( 'ProgramaFidelidade', $this->frequentFlyerCard );
        }

        if ($this->legalDocumentType) {
            $XMLWriter->writeElement( 'TipoDocumentoLegal', $this->legalDocumentType );
        } else {
            throw new RequiredFieldException( 'Field LegalDocumentType of the Passenger object is required' );
        }

        if ($this->legalDocument) {
            $XMLWriter->writeElement( 'DocumentoLegal', $this->legalDocument );
        } else {
            throw new RequiredFieldException( 'Field LegalDocument of the Passenger object is required' );
        }

        $XMLWriter->endElement();
    }
public function toXML( XMLWriter $XMLWriter )
    {
        $XMLWriter->startElement( 'Passageiro' );

        if ($this->name) {
            $XMLWriter->writeElement( 'Nome', $this->name );
        } else {
            throw new RequiredFieldException( 'Field Nome of the Passenger object is required' );
        }

        if ($this->frequentFlyerCard) {
            $XMLWriter->writeElement( 'ProgramaFidelidade', $this->frequentFlyerCard );
        }

        if ($this->legalDocumentType) {
            $XMLWriter->writeElement( 'TipoDocumentoLegal', $this->legalDocumentType );
        } else {
            throw new RequiredFieldException( 'Field LegalDocumentType of the Passenger object is required' );
        }

        if ($this->legalDocument) {
            $XMLWriter->writeElement( 'DocumentoLegal', $this->legalDocument );
        } else {
            throw new RequiredFieldException( 'Field LegalDocument of the Passenger object is required' );
        }

        $XMLWriter->endElement();
    }
@param  \XMLWriter $XMLWriter

@throws \RodrigoPedra\ClearSaleID\Exception\RequiredFieldException