getProducts(); $Categories = $this->_getCategoryTree(); if($Products&&$Categories){ $xml->loadXML(' '); $offers = $xml->getElementsByTagName('offers'); $offers = $offers->item(0); foreach ($Products AS $Product){ $offer = $xml->createElement('offer'); $offers->appendChild($offer); $id = $xml->createElement('id',$Product['id_product']); $offer->appendChild($id); //to avoid entity warning //$productName = str_replace("&", "&", $Product['name']); //again. one below is better ;) $name = $xml->createElement('name', self::htmlentities($Product['name'])); $offer->appendChild($name); $price = $xml->createElement('price',$this-> getTaxedPrice($Product)); $offer->appendChild($price); $url = $xml->createElement('url',htmlspecialchars($link->getProductLink($Product['id_product'], $Product['link_rewrite']))); $offer->appendChild($url); $categoryId = $xml->createElement('categoryId',$Categories[$Product['id_category_default']]['path']); $offer->appendChild($categoryId); $description_cdata = $xml->createCDATASection(strip_tags(html_entity_decode($Product['description_short'],ENT_COMPAT,"UTF-8"),"