18 $dom = new \DOMDocument(
'1.0',
'utf-8');
20 $productNode = $dom->createElement(
'Product');
22 foreach($this->fieldsMap as $bitrixFieldId => $ebayFieldPath)
24 if(isset($product[$bitrixFieldId]))
26 $arPath = $this->
parsePath($ebayFieldPath);
28 $newNode = $oldNewNode =
null;
30 foreach($arPath as $pathItem)
34 $newNode = $dom->createElement($pathItem);
37 $oldNewNode->appendChild($newNode);
39 $productNode->appendChild($newNode);
41 $oldNewNode = $newNode;
46 $newNode->nodeValue = $product[$bitrixFieldId];
50 return $dom->saveXML($productNode);