Add XML files.

@param string|bool $importXml
@param string|bool $offersXml
@param bool $ordersXml
763678
public function addXmls($importXml = false, $offersXml = false, $ordersXml = false)
    {
        $this->loadImportXml($importXml);
        $this->loadOffersXml($offersXml);
        $this->loadOrdersXml($ordersXml);
    }
687284
protected function parseXML($xml){
        if (!$xml){
            return false;
        }
        foreach($xml->Orders->children() as $key => $order){
            if ($key != 'Order'){
                break;
            }
            $this->orderList[$this->index] = new AmazonOrder($this->storeName,null,$order,$this->mockMode,$this->mockFiles,$this->config);
            $this->orderList[$this->index]->mockIndex = $this->mockIndex;
            $this->index++;
        }
    }
1264987
protected void addDescription(ModuleElement mdle, Content dlTree, SearchIndexItem si) {
        String moduleName = utils.getFullyQualifiedName(mdle);
        Content link = getModuleLink(mdle, new StringContent(moduleName));
        si.setLabel(moduleName);
        si.setCategory(resources.getText("doclet.Modules"));
        Content dt = HtmlTree.DT(link);
        dt.addContent(" - ");
        dt.addContent(contents.module_);
        dt.addContent(" " + moduleName);
        dlTree.addContent(dt);
        Content dd = new HtmlTree(HtmlTag.DD);
        addSummaryComment(mdle, dd);
        dlTree.addContent(dd);
    }
293504
def ligolw_add(xmldoc, urls, non_lsc_tables_ok = False, verbose = False, contenthandler = DefaultContentHandler):
	
	# Input
	for n, url in enumerate(urls):
		if verbose:
			print >>sys.stderr, "%d/%d:" % (n + 1, len(urls)),
		utils.load_url(url, verbose = verbose, xmldoc = xmldoc, contenthandler = contenthandler)

	# ID reassignment
	if not non_lsc_tables_ok and lsctables.HasNonLSCTables(xmldoc):
		raise ValueError("non-LSC tables found.  Use --non-lsc-tables-ok to force")
	reassign_ids(xmldoc, verbose = verbose)

	# Document merge
	if verbose:
		print >>sys.stderr, "merging elements ..."
	merge_ligolws(xmldoc)
	merge_compatible_tables(xmldoc)

	return xmldoc
708247
def fromXml(cls, xdata, filepath=''):
        
        module = None
        pkg_data = xdata.find('package')
        if pkg_data is not None:
            path = pkg_data.find('path').text
            name = pkg_data.find('name').text

            if filepath:
                path = os.path.join(filepath, path)

            path = os.path.abspath(path)
            sys.path.insert(0, path)
            sys.modules.pop(name, None)

            try:
                __import__(name)
                module = sys.modules[name]
            except (ImportError, KeyError):
                return None
        else:
            return None

        # generate the builder
        builder = cls(module)
        builder.loadXml(xdata, filepath=filepath)
        return builder
765221
protected function buildXml()
  {
    parent::buildXml();

   $checkedFiles = array();
   if ( !empty($_POST['files']) && is_array($_POST['files']) ){
     foreach ( $_POST['files'] as $file){
       $checkedFiles[$file['name']] = $file;
     }
   }

   for ($i = 0; $i < $this->zip->numFiles; $i++)
    {
      $fileName = $this->zip->getNameIndex($i);
      if ( !empty($checkedFiles[$fileName]) && $checkedFiles[$fileName]['options'] == 'ok' )
      {
        // file was sucessfully unzipped before
        $this->appendUnzippedNode($this->unzippedNodes,$fileName);
        continue;
      }

      $filePathInfo = pathinfo($fileName);
      $fileType = 'File';
      $fileStat = $this->zip->statName($i);
      if ( empty($filePathInfo['extension']) && empty($fileStat['size']) ){
        $fileType = 'Folder';
        // check if we can create subfolder
        if ( !$this->_currentFolder->checkAcl( CKFINDER_CONNECTOR_ACL_FOLDER_CREATE ) ){
          $this->errorCode = CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED;
          $this->appendErrorNode($this->skippedFilesNode, $this->errorCode, $fileName, $fileType);
          continue;
        }
      }
      $extractPath = $this->_currentFolder->getServerPath();
      $extractClientPath = $this->_currentFolder->getClientPath();

      $sFileName = $this->checkOneFile( $filePathInfo, $fileName );
      // security test failed, add to skipped
      if ( false !== $sFileName )
      {
        if ( file_exists($extractPath.$sFileName) )
        {
          if ( !is_dir($extractPath.$sFileName) )
          {
            // file was checked before
            if ( !empty($checkedFiles[$fileName]['options']) )
            {
              if ( $checkedFiles[$fileName]['options'] == 'autorename')
              {
                $sFileName = CKFinder_Connector_Utils_FileSystem::autoRename($extractPath,$sFileName);
                $this->extractTo($extractPath,$extractClientPath,$filePathInfo,$sFileName,$fileName);
              }
              elseif ( $checkedFiles[$fileName]['options'] == 'overwrite')
              {
                if ( !$this->_currentFolder->checkAcl( CKFINDER_CONNECTOR_ACL_FILE_DELETE ) ){
                  $this->errorCode = CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED;
                  $this->appendErrorNode($this->skippedFilesNode, $this->errorCode, $fileName, $fileType);
                  continue;
                }
                if (!CKFinder_Connector_Utils_FileSystem::unlink($extractPath.$sFileName))
                {
                  $this->errorCode = CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED;
                  $this->appendErrorNode($this->skippedFilesNode, $this->errorCode, $fileName, $fileType);
                }
                else
                {
                  $this->extractTo($extractPath,$extractClientPath,$filePathInfo,$sFileName,$fileName);
                }
              }
              else
              {
                // add to skipped files
                $this->appendUnzippedNode($this->unzippedNodes,$fileName,'skip');
              }
            }
            else
            {
              $this->errorCode = CKFINDER_CONNECTOR_ERROR_ALREADY_EXIST;
              $this->appendErrorNode($this->skippedFilesNode, $this->errorCode, $fileName, $fileType);
            }
          }
        }
        // file doesn't exist yet
        else
        {
          $this->extractTo($extractPath,$extractClientPath,$filePathInfo,$sFileName,$fileName);
        }
      }
    }
    $this->zip->close();

    $this->_connectorNode->addChild($this->unzippedNodes);

    if ($this->errorCode != CKFINDER_CONNECTOR_ERROR_NONE) {
      $this->_connectorNode->addChild($this->skippedFilesNode);
      $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ZIP_FAILED);
    }
  }
27619
public function addXML($xml)
    {
        $next_elem = $this->createDocumentFragment();
        $next_elem->appendXML($xml);
        $this->doc->appendChild($next_elem);

    }
879571
public function loadXML(string $XMLfile): void
    {
        $file = new FileManager();
        $this->xmlData = $file->loadLittleFile($XMLfile);
    }
1074464
def payment_orders
      xml do |xml|
        xml.css("paymentOrdersResult > paymentOrders > paymentOrder").map do |node|
          SubscriptionPaymentOrder.load_from_xml(node)
        end
      end
    end
1088375
protected function selectedForImport( \SimpleXMLElement $xml, array $match_ids ) {
		$selected_for_import = [];
		foreach ( $xml->spine->children() as $item ) {
			/** @var \SimpleXMLElement $item */
			// Get attributes
			$id = '';
			foreach ( $item->attributes() as $key => $val ) {
				if ( 'idref' === $key ) {
					$id = (string) $val;
				}
			}
			//Check this manifest item exists or not
			if ( isset( $this->manifest[ $id ] ) ) {
				// Flag
				$href = (string) $this->manifest[ $id ]['href'];
				if ( 'OEBPS/copyright.html' === $href ) {
					$this->pbCheck( $href );
				}
				// Skip
				if ( ! $this->flaggedForImport( $id ) ) {
					continue;
				}
				if ( ! isset( $match_ids[ $id ] ) ) {
					continue;
				}

				$selected_for_import[] = $id;
			}
		}

		return $selected_for_import;
	}
27225
protected function buildXml()
  {
    if (empty($_POST['CKFinderCommand']) || $_POST['CKFinderCommand'] != 'true') {
      $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
    }

    if (!extension_loaded('zip')) {
      $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_COMMAND);
    }

    $this->checkConnector();
    $this->checkRequest();

    if ( !$this->_currentFolder->checkAcl(CKFINDER_CONNECTOR_ACL_FILE_UPLOAD)) {
      $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED);
    }

    if (!isset($_POST["fileName"])) {
      $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_NAME);
    }

    $fileName = CKFinder_Connector_Utils_FileSystem::convertToFilesystemEncoding($_POST["fileName"]);
    $resourceTypeInfo = $this->_currentFolder->getResourceTypeConfig();

    if (!$resourceTypeInfo->checkExtension($fileName)) {
      $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_EXTENSION);
    }

    if (!CKFinder_Connector_Utils_FileSystem::checkFileName($fileName) || $resourceTypeInfo->checkIsHiddenFile($fileName)) {
      $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
    }

    $filePath = CKFinder_Connector_Utils_FileSystem::combinePaths($this->_currentFolder->getServerPath(), $fileName);

    if (!file_exists($filePath) || !is_file($filePath)) {
      $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_FILE_NOT_FOUND);
    }

    if (!is_writable(dirname($filePath))) {
      $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED);
    }

    if ( strtolower(pathinfo($fileName, PATHINFO_EXTENSION)) !== 'zip'){
      $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_EXTENSION);
    }

    $zip = new ZipArchive();
    $result = $zip->open($filePath);
    if ($result !== TRUE) {
      $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_UNKNOWN);
    }
    $this->zip = $zip;
    $this->filePath = $filePath;
    $this->_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");

    // list of unzipped nodes
    $this->unzippedNodes = new CKFinder_Connector_Utils_XmlNode("UnzippedFiles");

    // list of files which could not be unzipped
    $this->skippedFilesNode = new CKFinder_Connector_Utils_XmlNode("Errors");
    $this->errorCode = CKFINDER_CONNECTOR_ERROR_NONE;
  }
1370433
def rest_xml
      doc = REXML::Document.new APIConnection::XML_HEADER
      pkg = doc.add_element 'package'
      pkg.add_element('allow_uninstalled').text = @allow_uninstalled
      pkg.add_element('boot_volume_required').text = @boot_volume_required
      pkg.add_element('filename').text = @filename
      pkg.add_element('fill_existing_users').text = @fill_existing_users
      pkg.add_element('fill_user_template').text = @fill_user_template
      pkg.add_element('info').text = @info
      pkg.add_element('install_if_reported_available').text = @install_if_reported_available
      pkg.add_element('name').text = @name
      pkg.add_element('notes').text = @notes
      pkg.add_element('os_requirements').text = JSS.to_s_and_a(@os_requirements)[:stringform]
      pkg.add_element('priority').text = @priority
      pkg.add_element('reboot_required').text = @reboot_required
      pkg.add_element('required_processor').text = @required_processor.to_s.empty? ? 'None' : @required_processor
      pkg.add_element('send_notification').text = @send_notification
      pkg.add_element('switch_with_package').text = @switch_with_package

      pkg.add_element('hash_type').text = @checksum_type
      pkg.add_element('hash_value').text = @checksum.to_s

      add_category_to_xml(doc)
      doc.to_s
    end
1134814
protected function parseXml($xml) {
        if (!$xml){
            return false;
        }

        $this->needByDate = null;
        if (isset($xml->NeedByDate)) {
            $this->needByDate = (string)$xml->NeedByDate;
        }
        if (isset($xml->ConfirmedNeedByDate)) {
            $this->needByDate = (string)$xml->ConfirmedNeedByDate;
        }
        $this->fulfillableDate = (string)$xml->ConfirmedFulfillableDate;
        if (isset($xml->ShipmentContainsPreorderableItems)) {
            $this->hasPreorderItems = (string)$xml->ShipmentContainsPreorderableItems;
        }
        if (isset($xml->ShipmentConfirmedForPreorder)) {
            $this->isConfirmed = (string)$xml->ShipmentConfirmedForPreorder;
        }
    }
914344
protected function loadLowestPricedOfferXml($xml) {
        if (!$xml->Summary){
            return false;
        }

        //Identifier
        foreach($xml->Identifier->children() as $x){
            $this->data['Identifiers']['Identifier'][$x->getName()] = (string)$x;
        }

        //Summary
        $this->data['Summary']['TotalOfferCount'] = (string)$xml->Summary->TotalOfferCount;
        //Offer counts
        if ($xml->Summary->NumberOfOffers) {
            foreach($xml->Summary->NumberOfOffers->children() as $x){
                $att = (array)$x->attributes();
                $tchannel = 'UnknownChannel';
                if (isset($att['@attributes']['fulfillmentChannel'])) {
                    $tchannel = $att['@attributes']['fulfillmentChannel'];
                }
                $tcondition = 'UnknownCondition';
                if (isset($att['@attributes']['condition'])) {
                    $tcondition = $att['@attributes']['condition'];
                }
                $this->data['Summary']['NumberOfOffers'][$tchannel][$tcondition] = (string)$x;
            }
        }
        //Lowest prices
        if ($xml->Summary->LowestPrices) {
            foreach($xml->Summary->LowestPrices->children() as $x){
                $temp = array();
                foreach($x->children() as $y) {
                    foreach($y->children() as $z) {
                        $temp[$y->getName()][$z->getName()] = (string)$z;
                    }
                }
                $att = (array)$x->attributes();
                $tchannel = 'UnknownChannel';
                if (isset($att['@attributes']['fulfillmentChannel'])) {
                    $tchannel = $att['@attributes']['fulfillmentChannel'];
                }
                $tcondition = 'UnknownCondition';
                if (isset($att['@attributes']['condition'])) {
                    $tcondition = $att['@attributes']['condition'];
                }
                $this->data['Summary']['LowestPrices'][$tchannel][$tcondition] = $temp;
            }
        }
        //BuyBox prices
        if ($xml->Summary->BuyBoxPrices) {
            foreach($xml->Summary->BuyBoxPrices->children() as $x){
                $temp = array();
                foreach($x->children() as $y) {
                    foreach($y->children() as $z) {
                        $temp[$y->getName()][$z->getName()] = (string)$z;
                    }
                }
                $att = (array)$x->attributes();
                $tcondition = 'UnknownCondition';
                if (isset($att['@attributes']['condition'])) {
                    $tcondition = $att['@attributes']['condition'];
                }
                $this->data['Summary']['BuyBoxPrices'][$tcondition] = $temp;
            }
        }
        //List price
        if ($xml->Summary->ListPrice) {
            foreach($xml->Summary->ListPrice->children() as $x) {
                $this->data['Summary']['ListPrice'][$x->getName()] = (string)$x;
            }
        }
        //Lower price with shipping
        if ($xml->Summary->SuggestedLowerPricePlusShipping) {
            foreach($xml->Summary->SuggestedLowerPricePlusShipping->children() as $x) {
                $this->data['Summary']['SuggestedLowerPricePlusShipping'][$x->getName()] = (string)$x;
            }
        }
        //BuyBox offers
        if ($xml->Summary->BuyBoxEligibleOffers) {
            foreach($xml->Summary->BuyBoxEligibleOffers->children() as $x) {
                $att = (array)$x->attributes();
                $tchannel = 'UnknownChannel';
                if (isset($att['@attributes']['fulfillmentChannel'])) {
                    $tchannel = $att['@attributes']['fulfillmentChannel'];
                }
                $tcondition = 'UnknownCondition';
                if (isset($att['@attributes']['condition'])) {
                    $tcondition = $att['@attributes']['condition'];
                }
                $this->data['Summary']['BuyBoxEligibleOffers'][$tchannel][$tcondition] = (string)$x;
            }
        }
        //Offers
        foreach($xml->Offers->children() as $x){
            $temp = array();
            //Offer
            foreach($x->children() as $y){
                if ($y->children()->count() > 0){
                    foreach($y->children() as $z){
                        if ($z->children()->count() > 0){
                            foreach($z->children() as $zzz){
                                $temp[$y->getName()][$z->getName()][$zzz->getName()] = (string)$zzz;
                            }
                        } else {
                            $temp[$y->getName()][$z->getName()] = (string)$z;
                        }

                    }
                } else {
                    if ($y->getName() == 'ShippingTime') {
                        $att = (array)$y->attributes();
                        $temp['ShippingTime'] = array();
                        foreach ($att['@attributes'] as $zkey => $z) {
                            $temp['ShippingTime'][$zkey] = $z;
                        }
                    } else {
                        $temp[$y->getName()] = (string)$y;
                    }
                }
            }
            $this->data['Offers'][] = $temp;
        }
    }
812547
public function importTables ($xml, $objArchive, $intThemeId, $arrMapper)
	{
		// Store the field names of the theme tables
		$arrDbFields = array
		(
			'tl_elements'	=> $this->Database->getFieldNames('tl_elements'),
			'tl_pattern'	=> $this->Database->getFieldNames('tl_pattern')
		);
			
		// Lock the tables
		$arrLocks = array
		(
			'tl_elements'	=> 'WRITE',
			'tl_pattern'	=> 'WRITE',
			'tl_files'		=> 'READ',
			'tl_theme'		=> 'READ'
		);

		// Load the DCAs of the locked tables (see #7345)
		foreach (array_keys($arrLocks) as $table)
		{
			$this->loadDataContainer($table);
		}

		$this->Database->lockTables($arrLocks);

		// Get the current auto_increment values
		$tl_elements = $this->Database->getNextId('tl_elements');
		$tl_pattern = $this->Database->getNextId('tl_pattern');

		
		$tables = $xml->getElementsByTagName('table');
		
		// Update the mapper data first
		for ($i=0; $i<$tables->length; $i++)
		{
			$rows = $tables->item($i)->childNodes;
			$table = $tables->item($i)->getAttribute('name');

			// Skip all other tables
			if (!in_array($table, array_keys($arrDbFields)))
			{
				continue;
			}

			// Loop through the rows
			for ($j=0; $j<$rows->length; $j++)
			{
				$fields = $rows->item($j)->childNodes;

				// Loop through the fields
				for ($k=0; $k<$fields->length; $k++)
				{
					// Increment the ID
					if ($fields->item($k)->getAttribute('name') == 'id')
					{
						$arrMapper[$table][$fields->item($k)->nodeValue] = ${$table}++;
						break;
					}
				}
			}
		}

		// Loop through the tables
		for ($i=0; $i<$tables->length; $i++)
		{
			$rows = $tables->item($i)->childNodes;
			$table = $tables->item($i)->getAttribute('name');

			// Skip invalid tables
			if (!in_array($table, array_keys($arrDbFields)))
			{
				continue;
			}

			// Get the order fields
			$objDcaExtractor = \DcaExtractor::getInstance($table);
			$arrOrder = $objDcaExtractor->getOrderFields();

			// Loop through the rows
			for ($j=0; $j<$rows->length; $j++)
			{
				$set = array();
				$fields = $rows->item($j)->childNodes;

				// Loop through the fields
				for ($k=0; $k<$fields->length; $k++)
				{
					$value = $fields->item($k)->nodeValue;
					$name = $fields->item($k)->getAttribute('name');

					// Skip NULL values
					if ($value == 'NULL')
					{
						continue;
					}

					// Increment the ID
					elseif ($name == 'id')
					{
						$value = $arrMapper[$table][$value];
					}

					// Increment the parent IDs
					elseif ($name == 'pid')
					{
						if ($table == 'tl_pattern')
						{
							$value = $arrMapper['tl_elements'][$value];
						}
						else
						{
							$value = $arrMapper['tl_theme'][$value];
						}
					}

					// Adjust element alias
					elseif ($table == 'tl_elements' && $name == 'alias')
					{
						$objName = $this->Database->prepare("SELECT name FROM tl_theme WHERE id=?")
												  ->limit(1)
												  ->execute($set['pid']);

						$value = \StringUtil::generateAlias($objName->name . '-' . $set['title']);			  
					}


					// Replace the file paths in singleSRC fields with their tl_files ID
					elseif ($GLOBALS['TL_DCA'][$table]['fields'][$name]['inputType'] == 'fileTree' && !$GLOBALS['TL_DCA'][$table]['fields'][$name]['eval']['multiple'])
					{
						if (!$value)
						{
							$value = null; // Contao >= 3.2
						}
						else
						{
							// Do not use the FilesModel here - tables are locked!
							$objFile = $this->Database->prepare("SELECT uuid FROM tl_files WHERE path=?")
													  ->limit(1)
													  ->execute($this->customizeUploadPath($value));

							$value = $objFile->uuid;
						}
					}

					// Replace the file paths in multiSRC fields with their tl_files ID
					elseif ($GLOBALS['TL_DCA'][$table]['fields'][$name]['inputType'] == 'fileTree' || in_array($name, $arrOrder))
					{
						$tmp = \StringUtil::deserialize($value);

						if (is_array($tmp))
						{
							foreach ($tmp as $kk=>$vv)
							{
								// Do not use the FilesModel here - tables are locked!
								$objFile = $this->Database->prepare("SELECT uuid FROM tl_files WHERE path=?")
														  ->limit(1)
														  ->execute($this->customizeUploadPath($vv));

								$tmp[$kk] = $objFile->uuid;
							}

							$value = serialize($tmp);
						}
					}

					// Adjust the imageSize widget data
					elseif ($GLOBALS['TL_DCA'][$table]['fields'][$name]['inputType'] == 'imageSize')
					{
						$imageSizes = \StringUtil::deserialize($value, true);

						if (!empty($imageSizes))
						{
							if (is_numeric($imageSizes[2]))
							{
								$imageSizes[2] = $arrMapper['tl_image_size'][$imageSizes[2]];
							}
						}

						$value = serialize($imageSizes);
					}

					// Adjust the sizeList
					elseif ($table == 'tl_pattern' && $name == 'sizeList')
					{
						$imageSizes = \StringUtil::deserialize($value, true);

						if (!empty($imageSizes))
						{
							foreach ($imageSizes as $kk=>$vv)
							{
								$imageSizes[$kk] = $arrMapper['tl_image_size'][$vv];
								if (empty($imageSizes[$kk])) unset($imageSizes[$kk]); // Remove if no new size could be found
							}
						}
						
						$value = serialize($imageSizes);
					}

					$set[$name] = $value;
				}

				// Skip fields that are not in the database (e.g. because of missing extensions)
				foreach ($set as $k=>$v)
				{
					if (!in_array($k, $arrDbFields[$table]))
					{
						unset($set[$k]);
					}
				}
					
				// Insert into database
				$this->Database->prepare("INSERT INTO $table %s")->set($set)->execute();

			}
		}

		// Unlock the tables
		$this->Database->unlockTables();
	
		unset($tl_elements, $tl_pattern);
	}
357346
protected function parseXML($xml) {
        if (!$xml){
            return false;
        }
        if (!$xml->FulfillmentOrder){
            return false;
        }
        if (!$xml->FulfillmentOrderItem){
            return false;
        }
        if (!$xml->FulfillmentShipment){
            return false;
        }
        //Section 1: ShipmentOrder
        $d = $xml->FulfillmentOrder;
        $this->order['Details']['SellerFulfillmentOrderId'] = (string)$d->SellerFulfillmentOrderId;
        $this->order['Details']['MarketplaceId'] = (string)$d->MarketplaceId;
        $this->order['Details']['DisplayableOrderId'] = (string)$d->DisplayableOrderId;
        $this->order['Details']['DisplayableOrderDateTime'] = (string)$d->DisplayableOrderDateTime;
        $this->order['Details']['DisplayableOrderComment'] = (string)$d->DisplayableOrderComment;
        $this->order['Details']['ShippingSpeedCategory'] = (string)$d->ShippingSpeedCategory;
        if (isset($d->DeliveryWindow)) {
            $this->order['Details']['DeliveryWindow']['StartDateTime'] = (string)$d->DeliveryWindow->StartDateTime;
            $this->order['Details']['DeliveryWindow']['EndDateTime'] = (string)$d->DeliveryWindow->EndDateTime;
        }
        $this->order['Details']['DestinationAddress'] = $this->parseAddress($d->DestinationAddress);
        if (isset($d->FulfillmentAction)){
            $this->order['Details']['FulfillmentAction'] = (string)$d->FulfillmentAction;
        }
        if (isset($d->FulfillmentPolicy)){
            $this->order['Details']['FulfillmentPolicy'] = (string)$d->FulfillmentPolicy;
        }
        if (isset($d->FulfillmentMethod)){
            //deprecated
            $this->order['Details']['FulfillmentMethod'] = (string)$d->FulfillmentMethod;
        }
        $this->order['Details']['ReceivedDateTime'] = (string)$d->ReceivedDateTime;
        $this->order['Details']['FulfillmentOrderStatus'] = (string)$d->FulfillmentOrderStatus;
        $this->order['Details']['StatusUpdatedDateTime'] = (string)$d->StatusUpdatedDateTime;
        if (isset($d->NotificationEmailList)){
            $i = 0;
            foreach($d->NotificationEmailList->children() as $x){
                $this->order['Details']['NotificationEmailList'][$i++] = (string)$x;
            }
        }
        if (isset($d->CODSettings->IsCODRequired)){
            $this->order['Details']['CODSettings']['IsCODRequired'] = (string)$d->CODSettings->IsCODRequired;
        }
        if (isset($d->CODSettings->CODCharge)){
            $this->order['Details']['CODSettings']['CODCharge']['CurrencyCode'] = (string)$d->CODSettings->CODCharge->CurrencyCode;
            $this->order['Details']['CODSettings']['CODCharge']['Value'] = (string)$d->CODSettings->CODCharge->Value;
        }
        if (isset($d->CODSettings->CODChargeTax)){
            $this->order['Details']['CODSettings']['CODChargeTax']['CurrencyCode'] = (string)$d->CODSettings->CODChargeTax->CurrencyCode;
            $this->order['Details']['CODSettings']['CODChargeTax']['Value'] = (string)$d->CODSettings->CODChargeTax->Value;
        }
        if (isset($d->CODSettings->ShippingCharge)){
            $this->order['Details']['CODSettings']['ShippingCharge']['CurrencyCode'] = (string)$d->CODSettings->ShippingCharge->CurrencyCode;
            $this->order['Details']['CODSettings']['ShippingCharge']['Value'] = (string)$d->CODSettings->ShippingCharge->Value;
        }
        if (isset($d->CODSettings->ShippingChargeTax)){
            $this->order['Details']['CODSettings']['ShippingChargeTax']['CurrencyCode'] = (string)$d->CODSettings->ShippingChargeTax->CurrencyCode;
            $this->order['Details']['CODSettings']['ShippingChargeTax']['Value'] = (string)$d->CODSettings->ShippingChargeTax->Value;
        }
        
        //Section 2: Order Items
        $i = 0;
        foreach($xml->FulfillmentOrderItem->children() as $x){
            $this->order['Items'][$i]['SellerSKU'] = (string)$x->SellerSKU;
            $this->order['Items'][$i]['SellerFulfillmentOrderItemId'] = (string)$x->SellerFulfillmentOrderItemId;
            $this->order['Items'][$i]['Quantity'] = (string)$x->Quantity;
            if (isset($x->GiftMessage)){
                $this->order['Items'][$i]['GiftMessage'] = (string)$x->GiftMessage;
            }
            if (isset($x->DisplayableComment)){
                $this->order['Items'][$i]['DisplayableComment'] = (string)$x->DisplayableComment;
            }
            if (isset($x->FulfillmentNetworkSKU)){
                $this->order['Items'][$i]['FulfillmentNetworkSKU'] = (string)$x->FulfillmentNetworkSKU;
            }
            if (isset($x->OrderItemDisposition)){
                $this->order['Items'][$i]['OrderItemDisposition'] = (string)$x->OrderItemDisposition;
            }
            $this->order['Items'][$i]['CancelledQuantity'] = (string)$x->CancelledQuantity;
            $this->order['Items'][$i]['UnfulfillableQuantity'] = (string)$x->UnfulfillableQuantity;
            if (isset($x->EstimatedShipDateTime)){
                $this->order['Items'][$i]['EstimatedShipDateTime'] = (string)$x->EstimatedShipDateTime;
            }
            if (isset($x->EstimatedArrivalDateTime)){
                $this->order['Items'][$i]['EstimatedArrivalDateTime'] = (string)$x->EstimatedArrivalDateTime;
            }
            if (isset($x->PerUnitDeclaredValue)){
                $this->order['Items'][$i]['PerUnitDeclaredValue']['CurrencyCode'] = (string)$x->PerUnitDeclaredValue->CurrencyCode;
                $this->order['Items'][$i]['PerUnitDeclaredValue']['Value'] = (string)$x->PerUnitDeclaredValue->Value;
            }
            if (isset($x->PerUnitPrice)){
                $this->order['Items'][$i]['PerUnitPrice']['CurrencyCode'] = (string)$x->PerUnitPrice->CurrencyCode;
                $this->order['Items'][$i]['PerUnitPrice']['Value'] = (string)$x->PerUnitPrice->Value;
            }
            if (isset($x->PerUnitTax)){
                $this->order['Items'][$i]['PerUnitTax']['CurrencyCode'] = (string)$x->PerUnitTax->CurrencyCode;
                $this->order['Items'][$i]['PerUnitTax']['Value'] = (string)$x->PerUnitTax->Value;
            }
            $i++;
        }
        
        //Section 3: Order Shipments
        $i = 0;
        foreach($xml->FulfillmentShipment->children() as $x){
            $this->order['Shipments'][$i]['AmazonShipmentId'] = (string)$x->AmazonShipmentId;
            $this->order['Shipments'][$i]['FulfillmentCenterId'] = (string)$x->FulfillmentCenterId;
            $this->order['Shipments'][$i]['FulfillmentShipmentStatus'] = (string)$x->FulfillmentShipmentStatus;
            if (isset($x->ShippingDateTime)){
                $this->order['Shipments'][$i]['ShippingDateTime'] = (string)$x->ShippingDateTime;
            }
            if (isset($x->EstimatedArrivalDateTime)){
                $this->order['Shipments'][$i]['EstimatedArrivalDateTime'] = (string)$x->EstimatedArrivalDateTime;
            }
            //FulfillmentShipmentItem
            $j = 0;
            foreach ($x->FulfillmentShipmentItem->children() as $y){
                if (isset($y->SellerSKU)){
                    $this->order['Shipments'][$i]['FulfillmentShipmentItem'][$j]['SellerSKU'] = (string)$y->SellerSKU;
                }
                $this->order['Shipments'][$i]['FulfillmentShipmentItem'][$j]['SellerFulfillmentOrderItemId'] = (string)$y->SellerFulfillmentOrderItemId;
                $this->order['Shipments'][$i]['FulfillmentShipmentItem'][$j]['Quantity'] = (string)$y->Quantity;
                if (isset($y->PackageNumber)){
                    $this->order['Shipments'][$i]['FulfillmentShipmentItem'][$j]['PackageNumber'] = (string)$y->PackageNumber;
                }
                $j++;
            }
            if (isset($x->FulfillmentShipmentPackage)){
                $j = 0;
                foreach ($x->FulfillmentShipmentPackage->children() as $y){
                    $this->order['Shipments'][$i]['FulfillmentShipmentPackage'][$j]['PackageNumber'] = (string)$y->PackageNumber;
                    $this->order['Shipments'][$i]['FulfillmentShipmentPackage'][$j]['CarrierCode'] = (string)$y->CarrierCode;
                    if (isset($y->TrackingNumber)){
                        $this->order['Shipments'][$i]['FulfillmentShipmentPackage'][$j]['TrackingNumber'] = (string)$y->TrackingNumber;
                    }
                    if (isset($y->EstimatedArrivalDateTime)){
                        $this->order['Shipments'][$i]['FulfillmentShipmentPackage'][$j]['EstimatedArrivalDateTime'] = (string)$y->EstimatedArrivalDateTime;
                    }
                    $j++;
                }
            }
            
            $i++;
        }

        //Section 4: Return Items
        if (isset($xml->ReturnItemList)) {
            foreach ($xml->ReturnItemList->children() as $x) {
                $temp = array();
                $temp['SellerReturnItemId'] = (string)$x->SellerReturnItemId;
                $temp['SellerFulfillmentOrderItemId'] = (string)$x->SellerFulfillmentOrderItemId;
                $temp['AmazonShipmentId'] = (string)$x->AmazonShipmentId;
                $temp['SellerReturnReasonCode'] = (string)$x->SellerReturnReasonCode;
                if (isset($x->ReturnComment)) {
                    $temp['ReturnComment'] = (string)$x->ReturnComment;
                }
                if (isset($x->AmazonReturnReasonCode)) {
                    $temp['AmazonReturnReasonCode'] = (string)$x->AmazonReturnReasonCode;
                }
                $temp['Status'] = (string)$x->Status;
                $temp['StatusChangedDate'] = (string)$x->StatusChangedDate;
                if (isset($x->ReturnAuthorizationId)) {
                    $temp['ReturnAuthorizationId'] = (string)$x->ReturnAuthorizationId;
                }
                if (isset($x->ReturnReceivedCondition)) {
                    $temp['ReturnReceivedCondition'] = (string)$x->ReturnReceivedCondition;
                }
                if (isset($x->FulfillmentCenterId)) {
                    $temp['FulfillmentCenterId'] = (string)$x->FulfillmentCenterId;
                }
                $this->order['ReturnItems'][] = $temp;
            }
        }

        //Section 5: Return Authorizations
        if (isset($xml->ReturnAuthorizationList)) {
            foreach ($xml->ReturnAuthorizationList->children() as $x) {
                $temp = array();
                $temp['ReturnAuthorizationId'] = (string)$x->ReturnAuthorizationId;
                $temp['FulfillmentCenterId'] = (string)$x->FulfillmentCenterId;
                $temp['ReturnToAddress'] = $this->parseAddress($x->ReturnToAddress);
                $temp['AmazonRmaId'] = (string)$x->AmazonRmaId;
                $temp['RmaPageURL'] = (string)$x->RmaPageURL;
                $this->order['ReturnAuthorizations'][] = $temp;
            }
        }
    }
317646
private void addXmlBundle(CmsResource xmlBundle) {

        String name = xmlBundle.getName();
        String path = xmlBundle.getRootPath();
        m_bundleBaseNames.add(name);

        LOG.info(String.format("Adding property VFS bundle (path=%s, name=%s)", xmlBundle.getRootPath(), name));
        for (Locale locale : getAllLocales()) {
            CmsVfsBundleParameters params = new CmsVfsBundleParameters(
                name,
                path,
                locale,
                false,
                CmsVfsResourceBundle.TYPE_XML);
            CmsVfsResourceBundle bundle = new CmsVfsResourceBundle(params);
            addBundle(name, locale, bundle);
        }
    }