}
 }
 //Product Nav IDs
 $pri_navid = $p['navigation'];
 $sec_navid = array();
 $navids = explode(',', $p['navigation2']);
 foreach ($navids as $navid) {
     if ($navid != '' && $navid != '0') {
         $sec_navid[] = $navid;
     }
 }
 //XML PRODUCT DESCRIPTION
 $xml_content .= writeXMLopen('PRODUCTDATA', 0);
 $xml_content .= writeXMLline('P_ID', $p['products_id'], 1);
 $xml_content .= writeXMLline('P_NAME', $p['name'], 1);
 $p['description'] .= categoryExtraDescription($p['categories_id'], $sp_detail['languages_id']);
 $xml_content .= writeXMLline('P_TEXT_DESCRIPTION', $p['description'], 1);
 //$xml_content .= writeXMLline('P_TEXT_FEATURELIST', '', 1);
 //$xml_content .= writeXMLline('P_TEXT_SUPPLEMENT', '', 1);
 $xml_content .= writeLine();
 //XML PRODUCT COMPONENT (length, color, material, etc)
 //Neckermann Top Navigation as Product Component
 if ($p['navigation3'] != '') {
     //$component_id = '1131';
     $component_id = '7866970';
     $component_name = 'Geschlecht';
     $xml_content .= writeXMLopen('P_COMPONENT', 1);
     $xml_content .= writeXMLopen('COMPONENT', 2);
     $xml_content .= writeXMLline('COMPONENT_ID', $component_id, 3);
     $xml_content .= writeXMLline('COMPONENT_NAME', $component_name, 3);
     $xml_content .= writeXMLclose('COMPONENT', 2);
 //PRODUCTS NAME (Combination of Brand, Category and Name)
 //P_PREFIX (Brand)
 $xml_pprefix = $xmlt->drawTag($xml_product, 'P_PREFIX');
 $xmlt->drawTag($xml_pprefix, 'VALUE', $brand_name, array('xml:lang' => 'x-default'));
 //P_NAME_KEYWORD (Category)
 $xml_pnamekeyword = $xmlt->drawTag($xml_product, 'P_NAME_KEYWORD');
 $xmlt->drawTag($xml_pnamekeyword, 'VALUE', $category_name, array('xml:lang' => 'x-default'));
 //P_NAME_PROPER (Product Name)
 $xml_pnameproper = $xmlt->drawTag($xml_product, 'P_NAME_PROPER');
 $xmlt->drawTag($xml_pnameproper, 'VALUE', $product_name, array('xml:lang' => 'x-default'));
 //P_SUPPLEMENT (Ebay Name)
 $xml_psupplement = $xmlt->drawTag($xml_product, 'P_SUPPLEMENT');
 $xmlt->drawTag($xml_psupplement, 'VALUE', $ebay_name, array('xml:lang' => 'x-default'));
 //P_TEXT (Product Description)
 $xml_ptext = $xmlt->drawTag($xml_product, 'P_TEXT');
 $products_description = $parent_data['pd'][2]['products_description'] . categoryExtraDescription($parent_data['categories_id']);
 if ($parent_data['pd'][$lid]['products_description'] != '') {
     $xmlt->drawTag($xml_ptext, 'VALUE', $products_description, array('xml:lang' => 'x-default'));
 }
 //P_BRAND
 $xmlt->drawTag($xml_product, 'P_BRAND', '', array('identifier' => 'name', 'key' => $brand_name));
 //P_KEYWORDS
 $xml_pkeywords = $xmlt->drawTag($xml_product, 'P_KEYWORDS');
 $keywords = explode(',', $parent_data['pd'][$lid]['products_head_keywords_tag']);
 foreach ($keywords as $keyword) {
     $kword = explode(' ', trim($keyword));
     foreach ($kword as $kw) {
         if ($kw != '') {
             //P_KEYWORD
             $xml_pkeyword = $xmlt->drawTag($xml_pkeywords, 'P_KEYWORD');
             $xmlt->drawTag($xml_pkeyword, 'VALUE', $kw, array('xml:lang' => 'x-default'));
 $properName = strlen($p['name']) <= 50 ? $p['name'] : '';
 $maxkeywords = 94 - (strlen($brand_id) + strlen($properName));
 if ($maxkeywords > 64) {
     $maxkeywords = 64;
 }
 //don't send manual keywords to otto.de
 //$keywords = $p['keywords'];
 $keywords = '';
 $keywords_name = $properName == '' ? $p['name'] : '';
 $keywords = addAutoKeywords($keywords, $maxkeywords, $keywords_name, '', ', ');
 if ($keywords == '') {
     $keywords = $product_categories_name[$p['categories_id']];
 }
 $xml_content .= writeXMLline('KeyWord', $keywords, 2);
 //Product description
 $p['description'] .= str_replace("\n", '<br>', categoryExtraDescription($p['categories_id'], $sp_detail['languages_id']));
 $pd2data = $class_pm->retrieveDetail($p['products_id'], 'pd2');
 $desc2_label = $class_pm->description2_label($pd2data['pd2']);
 $proddesc2 = array();
 foreach ($desc2_label as $label => $value) {
     $proddesc2[] = $label . ': ' . $value;
 }
 $p['description'] .= '<br><br>Produktdetails:<br><ul><li>' . implode('</li><li>', $proddesc2) . '</li></ul>';
 $html_long_desc = $p['description'];
 $long_desc = strip_tags(str_replace('<li>', ' ', $html_long_desc));
 $xml_content .= writeXMLline('LongDesc', $long_desc, 2);
 $xml_content .= writeXMLline('HTMLLongDesc', $html_long_desc, 2);
 //Warengruppe / Class of Goods
 $warengruppe = translateOttoCategory($p['categories_id']);
 $xml_content .= writeXMLline('ClassOfGoods', $warengruppe, 2);
 //Product Navigatins (nav ids) / Cluster