private function buildPanEligibility($xml)
 {
     $panEligibility = new PanEligibility();
     $panEligibility->setRequestId((string) $xml->RequestId);
     $tmpSendingEligibility = new SendingEligibility();
     $sendingEligibility = $xml->SendingEligibility;
     $tmpSendingEligibility->setEligible((string) $sendingEligibility->Eligible);
     $tmpSendingEligibility->setReasonCode((string) $sendingEligibility->ReasonCode);
     $tmpSendingEligibility->setAccountNumber((string) $sendingEligibility->AccountNumber);
     $tmpSendingEligibility->setICA((string) $sendingEligibility->ICA);
     $tmpCurrency = new Currency();
     $currency = $sendingEligibility->Currency;
     $tmpCurrency->setAlphaCurrencyCode((string) $currency->AlphaCurrencyCode);
     $tmpCurrency->setNumericCurrencyCode((string) $currency->NumericCurrencyCode);
     $tmpCountry = new Country();
     $country = $sendingEligibility->Country;
     $tmpCountry->setAlphaCountryCode((string) $country->AlphaCountryCode);
     $tmpCountry->setNumericCountryCode((string) $country->NumericCountryCode);
     $tmpBrand = new Brand();
     $brand = $sendingEligibility->Brand;
     $tmpBrand->setAcceptanceBrandCode((string) $brand->AcceptanceBrandCode);
     $tmpBrand->setProductBrandCode((string) $brand->ProductBrandCode);
     $tmpSendingEligibility->setCurrency($tmpCurrency);
     $tmpSendingEligibility->setCountry($tmpCountry);
     $tmpSendingEligibility->setBrand($tmpBrand);
     $panEligibility->setSendingEligibility($tmpSendingEligibility);
     $tmpReceivingEligibility = new ReceivingEligibility();
     $receivingEligibility = $xml->ReceivingEligibility;
     $tmpReceivingEligibility->setEligible((string) $receivingEligibility->Eligible);
     $tmpReceivingEligibility->setReasonCode((string) $receivingEligibility->ReasonCode);
     $tmpReceivingEligibility->setAccountNumber((string) $receivingEligibility->AccountNumber);
     $tmpReceivingEligibility->setICA((string) $receivingEligibility->ICA);
     $tmpCurrency = new Currency();
     $currency = $receivingEligibility->Currency;
     $tmpCurrency->setAlphaCurrencyCode((string) $currency->AlphaCurrencyCode);
     $tmpCurrency->setNumericCurrencyCode((string) $currency->NumericCurrencyCode);
     $tmpCountry = new Country();
     $country = $receivingEligibility->Country;
     $tmpCountry->setAlphaCountryCode((string) $country->AlphaCountryCode);
     $tmpCountry->setNumericCountryCode((string) $country->NumericCountryCode);
     $tmpBrand = new Brand();
     $brand = $receivingEligibility->Brand;
     $tmpBrand->setAcceptanceBrandCode((string) $brand->AcceptanceBrandCode);
     $tmpBrand->setProductBrandCode((string) $brand->ProductBrandCode);
     $tmpReceivingEligibility->setCurrency($tmpCurrency);
     $tmpReceivingEligibility->setCountry($tmpCountry);
     $tmpReceivingEligibility->setBrand($tmpBrand);
     $panEligibility->setReceivingEligibility($tmpReceivingEligibility);
     return $panEligibility;
 }