Parse OPF metadata nodes

@param \SimpleXMLElement $xml
16034
protected function parseMetadata( \SimpleXMLElement $xml ) {

		foreach ( $xml->metadata->children( 'dc', true ) as $key => $val ) {

			$val = (string) $val;

			// Set authors
			if ( 'creator' === $key && ! empty( $val ) ) {
				$this->authors .= trim( $val ) . ', ';
			} elseif ( 'contributor' === $key && ! empty( $val ) ) {
				$this->authors .= trim( $val ) . ', ';
			}
		}

		// Get rid of trailing comma
		$this->authors = rtrim( $this->authors, ', ' );
	}
445103
protected function parseXML($xml){
        if (!$xml){
            return false;
        }
        
        $this->response = array();
        $this->response['FeedSubmissionId'] = (string)$xml->FeedSubmissionId;
        $this->response['FeedType'] = (string)$xml->FeedType;
        $this->response['SubmittedDate'] = (string)$xml->SubmittedDate;
        $this->response['FeedProcessingStatus'] = (string)$xml->FeedProcessingStatus;
        
        $this->log("Successfully submitted feed #".$this->response['FeedSubmissionId'].' ('.$this->response['FeedType'].')');
    }
172368
public static function parseElementXml(SimpleXMLElement $xml){

        $attributes = array();
        foreach($xml->attributes() as $name => $value){
            $attributes[$name] = (string) $value;
        }

        $returnValue = array(
            'qtiClass' => $xml->getName()
        );

        if(count($attributes)){
            $returnValue['attributes'] = $attributes;
        }

        return $returnValue;
    }
600301
protected function parseFilters(SimpleXMLElement $xml)
    {
        if (false === $filters = $xml->xpath('//config:filters/config:filter')) {
            return;
        }
        try {
            $filterConfig = $this->container->getParameter("Thelia.parser.filters");
        } catch (ParameterNotFoundException $e) {
            $filterConfig = array();
        }

        foreach ($filters as $filter) {
            $filterConfig[$this->getAttributeAsPhp($filter, "name")] = $this->getAttributeAsPhp($filter, "class");
        }

        $this->container->setParameter("Thelia.parser.filters", $filterConfig);
    }
839561
protected function parseXML($xml){
        if (!$xml){
            return false;
        }
        $d = array();
        $d['AmazonOrderId'] = (string)$xml->AmazonOrderId;
        if (isset($xml->SellerOrderId)){
            $d['SellerOrderId'] = (string)$xml->SellerOrderId;
        }
        $d['PurchaseDate'] = (string)$xml->PurchaseDate;
        $d['LastUpdateDate'] = (string)$xml->LastUpdateDate;
        $d['OrderStatus'] = (string)$xml->OrderStatus;
        if (isset($xml->FulfillmentChannel)){
            $d['FulfillmentChannel'] = (string)$xml->FulfillmentChannel;
        }
        if (isset($xml->SalesChannel)){
            $d['SalesChannel'] = (string)$xml->SalesChannel;
        }
        if (isset($xml->OrderChannel)){
            $d['OrderChannel'] = (string)$xml->OrderChannel;
        }
        if (isset($xml->ShipServiceLevel)){
            $d['ShipServiceLevel'] = (string)$xml->ShipServiceLevel;
        }
        if (isset($xml->ShippingAddress)){
            $d['ShippingAddress'] = array();
            $d['ShippingAddress']['Name'] = (string)$xml->ShippingAddress->Name;
            $d['ShippingAddress']['AddressLine1'] = (string)$xml->ShippingAddress->AddressLine1;
            $d['ShippingAddress']['AddressLine2'] = (string)$xml->ShippingAddress->AddressLine2;
            $d['ShippingAddress']['AddressLine3'] = (string)$xml->ShippingAddress->AddressLine3;
            $d['ShippingAddress']['City'] = (string)$xml->ShippingAddress->City;
            $d['ShippingAddress']['County'] = (string)$xml->ShippingAddress->County;
            $d['ShippingAddress']['District'] = (string)$xml->ShippingAddress->District;
            $d['ShippingAddress']['StateOrRegion'] = (string)$xml->ShippingAddress->StateOrRegion;
            $d['ShippingAddress']['PostalCode'] = (string)$xml->ShippingAddress->PostalCode;
            $d['ShippingAddress']['CountryCode'] = (string)$xml->ShippingAddress->CountryCode;
            $d['ShippingAddress']['Phone'] = (string)$xml->ShippingAddress->Phone;
        }
        if (isset($xml->OrderTotal)){
            $d['OrderTotal'] = array();
            $d['OrderTotal']['Amount'] = (string)$xml->OrderTotal->Amount;
            $d['OrderTotal']['CurrencyCode'] = (string)$xml->OrderTotal->CurrencyCode;
        }
        if (isset($xml->NumberOfItemsShipped)){
            $d['NumberOfItemsShipped'] = (string)$xml->NumberOfItemsShipped;
        }
        if (isset($xml->NumberOfItemsUnshipped)){
            $d['NumberOfItemsUnshipped'] = (string)$xml->NumberOfItemsUnshipped;
        }
        if (isset($xml->PaymentExecutionDetail)){
            $d['PaymentExecutionDetail'] = array();
            
            $i = 0;
            foreach($xml->PaymentExecutionDetail->children() as $x){
                $d['PaymentExecutionDetail'][$i]['Amount'] = (string)$x->Payment->Amount;
                $d['PaymentExecutionDetail'][$i]['CurrencyCode'] = (string)$x->Payment->CurrencyCode;
                $d['PaymentExecutionDetail'][$i]['SubPaymentMethod'] = (string)$x->SubPaymentMethod;
                $i++;
            }
        }
        if (isset($xml->PaymentMethod)){
            $d['PaymentMethod'] = (string)$xml->PaymentMethod;
        }
        if (isset($xml->PaymentMethodDetails)){
            foreach ($xml->PaymentMethodDetails as $x) {
                $d['PaymentMethodDetails'][] = (string)$x->PaymentMethodDetail;
            }
        }
        if (isset($xml->IsReplacementOrder)){
            $d['IsReplacementOrder'] = (string)$xml->IsReplacementOrder;
            $d['ReplacedOrderId'] = (string)$xml->ReplacedOrderId;
        }
        $d['MarketplaceId'] = (string)$xml->MarketplaceId;
        if (isset($xml->BuyerName)){
            $d['BuyerName'] = (string)$xml->BuyerName;
        }
        if (isset($xml->BuyerEmail)){
            $d['BuyerEmail'] = (string)$xml->BuyerEmail;
        }
        if (isset($xml->BuyerCounty)){
            $d['BuyerCounty'] = (string)$xml->BuyerCounty;
        }
        if (isset($xml->BuyerTaxInfo)){
            $d['BuyerTaxInfo'] = array();
            if (isset($xml->BuyerTaxInfo->CompanyLegalName)){
                $d['BuyerTaxInfo']['CompanyLegalName'] = (string)$xml->BuyerTaxInfo->CompanyLegalName;
            }
            if (isset($xml->BuyerTaxInfo->TaxingRegion)){
                $d['BuyerTaxInfo']['TaxingRegion'] = (string)$xml->BuyerTaxInfo->TaxingRegion;
            }
            if (isset($xml->BuyerTaxInfo->TaxClassifications)){
                foreach($xml->BuyerTaxInfo->TaxClassifications->children() as $x){
                    $temp = array();
                    $temp['Name'] = (string)$x->Name;
                    $temp['Value'] = (string)$x->Value;
                    $d['BuyerTaxInfo']['TaxClassifications'][] = $temp;
                }
            }
        }
        if (isset($xml->ShipmentServiceLevelCategory)){
            $d['ShipmentServiceLevelCategory'] = (string)$xml->ShipmentServiceLevelCategory;
        }
        if (isset($xml->CbaDisplayableShippingLabel)){
            $d['CbaDisplayableShippingLabel'] = (string)$xml->CbaDisplayableShippingLabel;
        }
        if (isset($xml->ShippedByAmazonTFM)){
            $d['ShippedByAmazonTFM'] = (string)$xml->ShippedByAmazonTFM;
        }
        if (isset($xml->TFMShipmentStatus)){
            $d['TFMShipmentStatus'] = (string)$xml->TFMShipmentStatus;
        }
        if (isset($xml->OrderType)){
            $d['OrderType'] = (string)$xml->OrderType;
        }
        if (isset($xml->EarliestShipDate)){
            $d['EarliestShipDate'] = (string)$xml->EarliestShipDate;
        }
        if (isset($xml->LatestShipDate)){
            $d['LatestShipDate'] = (string)$xml->LatestShipDate;
        }
        if (isset($xml->EarliestDeliveryDate)){
            $d['EarliestDeliveryDate'] = (string)$xml->EarliestDeliveryDate;
        }
        if (isset($xml->LatestDeliveryDate)){
            $d['LatestDeliveryDate'] = (string)$xml->LatestDeliveryDate;
        }
        if (isset($xml->IsBusinessOrder)){
            $d['IsBusinessOrder'] = (string)$xml->IsBusinessOrder;
        }
        if (isset($xml->PurchaseOrderNumber)){
            $d['PurchaseOrderNumber'] = (string)$xml->PurchaseOrderNumber;
        }
        if (isset($xml->IsPrime)){
            $d['IsPrime'] = (string)$xml->IsPrime;
        }
        if (isset($xml->IsPremiumOrder)){
            $d['IsPremiumOrder'] = (string)$xml->IsPremiumOrder;
        }
        
        $this->data = $d;
    }
338106
public function FromXML($xml)
	{
		$sxo = new SimpleXMLElement($xml);
		
		if($sxo->encoding == "base64")
		{
			$this->Data = base64_decode($sxo->data);
		}
		else
		{
			$this->Data = $sxo->data;
		}
		
		$this->Name = $attachment->name;
		$this->Type = $attachment->type;
		$this->Size = $attachment->size;
		$this->Extension = $attachment->extension;
	}
1315490
private function parseXml($xml)
    {
        $priorSetting = libxml_use_internal_errors(true);
        try {
            libxml_clear_errors();
            $xmlPayload = new \SimpleXMLElement($xml);
            if ($error = libxml_get_last_error()) {
                throw new \RuntimeException($error->message);
            }
        } catch (\Exception $e) {
            throw new ParserException("Error parsing XML: {$e->getMessage()}", 0, $e);
        } finally {
            libxml_use_internal_errors($priorSetting);
        }

        return $xmlPayload;
    }
89626
private static function xml2array(\SimpleXMLElement $xml)
    {
        $arr = [];

        if ($xml) {
            foreach ($xml->children() as $r) {
                $t = [];
                if (!is_null($r) && count($r->children()) == 0) {
                    $arr[$r->getName()] = strval($r);
                } else {
                    $arr[$r->getName()][] = self::xml2array($r);
                }
            }
        }

        return $arr;
    }
306890
public function parseFromXml($simpleXml)
    {
        if (!isset($simpleXml->{'order-items'})) {
            return;
        }

        if ($simpleXml->{'order-items'}->children()->count() < 1) {
            return;
        }

        $basketVersion = '';
        switch ((string)$simpleXml->{'payment-methods'}->{'payment-method'}['name']) {
            case PayPalTransaction::NAME:
                $basketVersion = PayPalTransaction::class;
                break;
            case RatepayInvoiceTransaction::NAME:
            case RatepayInstallmentTransaction::NAME:
                $basketVersion = RatepayTransaction::class;
                break;
        }

        foreach ($simpleXml->{'order-items'}->children() as $orderItem) {
            $amountAttrs = $orderItem->amount->attributes();
            $amount = new Amount(
                (float)$orderItem->amount,
                (string)$amountAttrs->currency
            );

            $basketItem = new Item((string)$orderItem->name, $amount, (int)$orderItem->quantity);

            if (isset($orderItem->{'tax-amount'})) {
                $taxAmountAttrs = $orderItem->{'tax-amount'}->attributes();
                $taxAmount = new Amount(
                    (float)$orderItem->{'tax-amount'},
                    (string)$taxAmountAttrs->currency
                );
                $basketItem->setTaxAmount($taxAmount);
            }
            $basketItem->setVersion($basketVersion)
                ->setDescription((string)$orderItem->description)
                ->setArticleNumber((string)$orderItem->{'article-number'});

            $this->add($basketItem);
        }

        return $this;
    }
682205
protected function parseValues(\SimpleXMLElement $node)
    {
        $values = [];

        foreach ($node->value as $item) {
            if ($item->count() > 0) {
                $value = $this->parseValues($item);
            } else {
                $value = trim($item);
            }

            if (isset($item['key'])) {
                $values[(string) $item['key']] = $value;
            } else {
                $values[] = $value;
            }
        }

        return $values;
    }
495143
protected function parseXML($xml){
        if (!$xml){
            return false;
        }
        
        foreach($xml->children() as $key=>$x){
            $i = $this->index;
            if ($key == 'Count'){
                $this->count = (string)$x;
                $this->log("Successfully canceled $this->count report requests.");
            }
            if ($key != 'ReportRequestInfo'){
                continue;
            }
            
            $this->reportList[$i]['ReportRequestId'] = (string)$x->ReportRequestId;
            $this->reportList[$i]['ReportType'] = (string)$x->ReportType;
            $this->reportList[$i]['StartDate'] = (string)$x->StartDate;
            $this->reportList[$i]['EndDate'] = (string)$x->EndDate;
            $this->reportList[$i]['Scheduled'] = (string)$x->Scheduled;
            $this->reportList[$i]['SubmittedDate'] = (string)$x->SubmittedDate;
            $this->reportList[$i]['ReportProcessingStatus'] = (string)$x->ReportProcessingStatus;
            $this->reportList[$i]['GeneratedReportId'] = (string)$x->GeneratedReportId;
            $this->reportList[$i]['StartedProcessingDate'] = (string)$x->StartedProcessingDate;
            $this->reportList[$i]['CompletedDate'] = (string)$x->CompletedDate;
            
            $this->index++;
        }
    }
1103353
protected function parseXml($xml) {
        if (!$xml) {
            return false;
        }
        if (isset($xml->ShipmentEventList)) {
            foreach($xml->ShipmentEventList->children() as $x) {
                $this->list['Shipment'][] = $this->parseShipmentEvent($x);
            }
        }
        if (isset($xml->RefundEventList)) {
            foreach($xml->RefundEventList->children() as $x) {
                $this->list['Refund'][] = $this->parseShipmentEvent($x);
            }
        }
        if (isset($xml->GuaranteeClaimEventList)) {
            foreach($xml->GuaranteeClaimEventList->children() as $x) {
                $this->list['GuaranteeClaim'][] = $this->parseShipmentEvent($x);
            }
        }
        if (isset($xml->ChargebackEventList)) {
            foreach($xml->ChargebackEventList->children() as $x) {
                $this->list['Chargeback'][] = $this->parseShipmentEvent($x);
            }
        }
        if (isset($xml->PayWithAmazonEventList)) {
            foreach($xml->PayWithAmazonEventList->children() as $x) {
                $temp = array();
                $temp['SellerOrderId'] = (string)$x->SellerOrderId;
                $temp['TransactionPostedDate'] = (string)$x->TransactionPostedDate;
                $temp['BusinessObjectType'] = (string)$x->BusinessObjectType;
                $temp['SalesChannel'] = (string)$x->SalesChannel;
                $temp['Charge'] = $this->parseCharge($x->Charge);
                if (isset($x->FeeList)) {
                    foreach($x->FeeList->children() as $z) {
                        $temp['FeeList'][] = $this->parseFee($z);
                    }
                }
                $temp['PaymentAmountType'] = (string)$x->PaymentAmountType;
                $temp['AmountDescription'] = (string)$x->AmountDescription;
                $temp['FulfillmentChannel'] = (string)$x->FulfillmentChannel;
                $temp['StoreName'] = (string)$x->StoreName;
                $this->list['PayWithAmazon'][] = $temp;
            }
        }
        if (isset($xml->ServiceProviderCreditEventList)) {
            foreach($xml->ServiceProviderCreditEventList->children() as $x) {
                $temp = array();
                $temp['ProviderTransactionType'] = (string)$x->ProviderTransactionType;
                $temp['SellerOrderId'] = (string)$x->SellerOrderId;
                $temp['MarketplaceId'] = (string)$x->MarketplaceId;
                $temp['MarketplaceCountryCode'] = (string)$x->MarketplaceCountryCode;
                $temp['SellerId'] = (string)$x->SellerId;
                $temp['SellerStoreName'] = (string)$x->SellerStoreName;
                $temp['ProviderId'] = (string)$x->ProviderId;
                $temp['ProviderStoreName'] = (string)$x->ProviderStoreName;
                $this->list['ServiceProviderCredit'][] = $temp;
            }
        }
        if (isset($xml->RetrochargeEventList)) {
            foreach($xml->RetrochargeEventList->children() as $x) {
                $temp = array();
                $temp['RetrochargeEventType'] = (string)$x->RetrochargeEventType;
                $temp['AmazonOrderId'] = (string)$x->AmazonOrderId;
                $temp['PostedDate'] = (string)$x->PostedDate;
                $temp['BaseTax']['Amount'] = (string)$x->BaseTax->CurrencyAmount;
                $temp['BaseTax']['CurrencyCode'] = (string)$x->BaseTax->CurrencyCode;
                $temp['ShippingTax']['Amount'] = (string)$x->ShippingTax->CurrencyAmount;
                $temp['ShippingTax']['CurrencyCode'] = (string)$x->ShippingTax->CurrencyCode;
                $temp['MarketplaceName'] = (string)$x->MarketplaceName;
                $this->list['Retrocharge'][] = $temp;
            }
        }
        if (isset($xml->RentalTransactionEventList)) {
            foreach($xml->RentalTransactionEventList->children() as $x) {
                $temp = array();
                $temp['AmazonOrderId'] = (string)$x->AmazonOrderId;
                $temp['RentalEventType'] = (string)$x->RentalEventType;
                $temp['ExtensionLength'] = (string)$x->ExtensionLength;
                $temp['PostedDate'] = (string)$x->PostedDate;
                if (isset($x->RentalChargeList)) {
                    foreach($x->RentalChargeList->children() as $z) {
                        $temp['RentalChargeList'][] = $this->parseCharge($z);
                    }
                }
                if (isset($x->RentalFeeList)) {
                    foreach($x->RentalFeeList->children() as $z) {
                        $temp['RentalFeeList'][] = $this->parseFee($z);
                    }
                }
                $temp['MarketplaceName'] = (string)$x->MarketplaceName;
                if (isset($x->RentalInitialValue)) {
                    $temp['RentalInitialValue']['Amount'] = (string)$x->RentalInitialValue->CurrencyAmount;
                    $temp['RentalInitialValue']['CurrencyCode'] = (string)$x->RentalInitialValue->CurrencyCode;
                }
                if (isset($x->RentalReimbursement)) {
                    $temp['RentalReimbursement']['Amount'] = (string)$x->RentalReimbursement->CurrencyAmount;
                    $temp['RentalReimbursement']['CurrencyCode'] = (string)$x->RentalReimbursement->CurrencyCode;
                }
                $this->list['RentalTransaction'][] = $temp;
            }
        }
        if (isset($xml->PerformanceBondRefundEventList)) {
            foreach($xml->PerformanceBondRefundEventList->children() as $x) {
                $temp = array();
                $temp['MarketplaceCountryCode'] = (string)$x->MarketplaceCountryCode;
                $temp['Amount'] = (string)$x->Amount->CurrencyAmount;
                $temp['CurrencyCode'] = (string)$x->Amount->CurrencyCode;
                if (isset($x->ProductGroupList)) {
                    foreach($x->ProductGroupList->children() as $z) {
                        $temp['ProductGroupList'][] = (string)$z;
                    }
                }
                $this->list['PerformanceBondRefund'][] = $temp;
            }
        }
        if (isset($xml->ServiceFeeEventList)) {
            foreach($xml->ServiceFeeEventList->children() as $x) {
                $temp = array();
                $temp['AmazonOrderId'] = (string)$x->AmazonOrderId;
                $temp['FeeReason'] = (string)$x->FeeReason;
                if (isset($x->FeeList)) {
                    foreach($x->FeeList->children() as $z) {
                        $temp['FeeList'][] = $this->parseFee($z);
                    }
                }
                $temp['SellerSKU'] = (string)$x->SellerSKU;
                $temp['FnSKU'] = (string)$x->FnSKU;
                $temp['FeeDescription'] = (string)$x->FeeDescription;
                $temp['ASIN'] = (string)$x->ASIN;
                $this->list['ServiceFee'][] = $temp;
            }
        }
        if (isset($xml->DebtRecoveryEventList)) {
            foreach($xml->DebtRecoveryEventList->children() as $x) {
                $temp = array();
                $temp['DebtRecoveryType'] = (string)$x->DebtRecoveryType;
                $temp['RecoveryAmount']['Amount'] = (string)$x->RecoveryAmount->CurrencyAmount;
                $temp['RecoveryAmount']['CurrencyCode'] = (string)$x->RecoveryAmount->CurrencyCode;
                $temp['OverPaymentCredit']['Amount'] = (string)$x->OverPaymentCredit->CurrencyAmount;
                $temp['OverPaymentCredit']['CurrencyCode'] = (string)$x->OverPaymentCredit->CurrencyCode;
                if (isset($x->DebtRecoveryItemList)) {
                    foreach($x->DebtRecoveryItemList->children() as $z) {
                        $ztemp = array();
                        $ztemp['RecoveryAmount']['Amount'] = (string)$z->RecoveryAmount->CurrencyAmount;
                        $ztemp['RecoveryAmount']['CurrencyCode'] = (string)$z->RecoveryAmount->CurrencyCode;
                        $ztemp['OriginalAmount']['Amount'] = (string)$z->OriginalAmount->CurrencyAmount;
                        $ztemp['OriginalAmount']['CurrencyCode'] = (string)$z->OriginalAmount->CurrencyCode;
                        $ztemp['GroupBeginDate'] = (string)$z->GroupBeginDate;
                        $ztemp['GroupEndDate'] = (string)$z->GroupEndDate;
                        $temp['DebtRecoveryItemList'][] = $ztemp;
                    }
                }
                if (isset($x->ChargeInstrumentList)) {
                    foreach($x->ChargeInstrumentList->children() as $z) {
                        $ztemp = array();
                        $ztemp['Description'] = (string)$z->Description;
                        $ztemp['Tail'] = (string)$z->Tail;
                        $ztemp['Amount'] = (string)$z->Amount->CurrencyAmount;
                        $ztemp['CurrencyCode'] = (string)$z->Amount->CurrencyCode;
                        $temp['ChargeInstrumentList'][] = $ztemp;
                    }
                }
                $this->list['DebtRecovery'][] = $temp;
            }
        }
        if (isset($xml->LoanServicingEventList)) {
            foreach($xml->LoanServicingEventList->children() as $x) {
                $temp = array();
                $temp['Amount'] = (string)$x->LoanAmount->CurrencyAmount;
                $temp['CurrencyCode'] = (string)$x->LoanAmount->CurrencyCode;
                $temp['SourceBusinessEventType'] = (string)$x->SourceBusinessEventType;
                $this->list['LoanServicing'][] = $temp;
            }
        }
        if (isset($xml->AdjustmentEventList)) {
            foreach($xml->AdjustmentEventList->children() as $x) {
                $temp = array();
                $temp['AdjustmentType'] = (string)$x->AdjustmentType;
                $temp['Amount'] = (string)$x->AdjustmentAmount->CurrencyAmount;
                $temp['CurrencyCode'] = (string)$x->AdjustmentAmount->CurrencyCode;
                if (isset($x->AdjustmentItemList)) {
                    foreach($x->AdjustmentItemList->children() as $z) {
                        $ztemp = array();
                        $ztemp['Quantity'] = (string)$z->Quantity;
                        $ztemp['PerUnitAmount']['Amount'] = (string)$z->PerUnitAmount->CurrencyAmount;
                        $ztemp['PerUnitAmount']['CurrencyCode'] = (string)$z->PerUnitAmount->CurrencyCode;
                        $ztemp['TotalAmount']['Amount'] = (string)$z->TotalAmount->CurrencyAmount;
                        $ztemp['TotalAmount']['CurrencyCode'] = (string)$z->TotalAmount->CurrencyCode;
                        $ztemp['SellerSKU'] = (string)$z->SellerSKU;
                        $ztemp['FnSKU'] = (string)$z->FnSKU;
                        $ztemp['ProductDescription'] = (string)$z->ProductDescription;
                        $ztemp['ASIN'] = (string)$z->ASIN;
                        $temp['AdjustmentItemList'][] = $ztemp;
                    }
                }
                $this->list['Adjustment'][] = $temp;
            }
        }
        if (isset($xml->SAFETReimbursementEventList)) {
            foreach($xml->SAFETReimbursementEventList->children() as $x) {
                $temp = array();
                $temp['PostedDate'] = (string)$x->PostedDate;
                $temp['SAFETClaimId'] = (string)$x->SAFETClaimId;
                $temp['Amount'] = (string)$x->ReimbursedAmount->CurrencyAmount;
                $temp['CurrencyCode'] = (string)$x->ReimbursedAmount->CurrencyCode;
                $temp['SAFETReimbursementItemList'] = array();
                if (isset($x->SAFETReimbursementItemList)) {
                    foreach($x->SAFETReimbursementItemList->children() as $y) {
                        if (!isset($y->ItemChargeList)) {
                            continue;
                        }
                        $ztemp = array();
                        foreach($y->ItemChargeList->children() as $z) {
                            $ztemp['ItemChargeList'][] = $this->parseCharge($z);
                        }
                        $temp['SAFETReimbursementItemList'][] = $ztemp;
                    }
                }
                $this->list['SAFET'][] = $temp;
            }
        }
    }
507515
private function parse(\SimpleXMLElement $xmldata)
    {
        if (!isset($xmldata->title)) {

            throw new OpdsParserNoTitleException();
        }

        if ($xmldata->getName() === 'entry') {

            return $this->parseEntry($xmldata);
        }

        return $this->parseFeed($xmldata);
    }
361610
protected function parseXML($xml){
        if (!$xml){
            return false;
        }
        foreach($xml->children() as $key=>$x){
            if ($key == 'Count'){
                $this->count = (string)$x;
            }
            if ($key != 'ReportSchedule'){
                continue;
            }
            $i = $this->index;
            
            $this->scheduleList[$i]['ReportType'] = (string)$x->ReportType;
            $this->scheduleList[$i]['Schedule'] = (string)$x->Schedule;
            $this->scheduleList[$i]['ScheduledDate'] = (string)$x->ScheduledDate;
            
            $this->index++;
        }
    }
1112385
public function parse( $xml )
	{
		$this->loadXml( $xml );
		$root	= $this->document->firstChild;
		while( $root->nodeType == XML_COMMENT_NODE )
			$root	= $root->nextSibling;

		$tree	= new XML_DOM_Node( $root->nodeName );
		if( $root->hasAttributes())
		{
			$attributeNodes	= $root->attributes;
			foreach( $attributeNodes as $attributeNode )
				$tree->setAttribute( $attributeNode->nodeName, $attributeNode->nodeValue );
		}
		$this->parseRecursive( $root, $tree );
		return $tree;
	}
1164724
protected static function xmlToArray(\SimpleXMLElement $xml)/*# : array */
    {
        $arr = array();
        foreach ($xml as $element) {
            $tag = $element->getName();
            $ele = get_object_vars($element);
            if (!empty($ele)) {
                $arr[$tag] = $element instanceof \SimpleXMLElement ?
                    static::xmlToArray($element) :
                    $ele;
            } else {
                $arr[$tag] = trim($element);
            }
        }
        return $arr;
    }
1066368
protected static function parseRss(\SimpleXMLElement $xml)
    {
        if (isset($xml->item)) {
            $items = $xml->item;
        } elseif (isset($xml->channel)) {
            $items = $xml->channel->item;
        } else {
            return false;
        }

        return [
            'url' => (string) $xml->channel->link,
            'items' => self::getRssItems($items),
        ];
    }