izar74,
your code and the results does not make sense. first off, are you sure you have the proper closing curly bracket '}' for each if statement?
second, your products_model looks wrong. from the feed output, i see an XML element called <g:mpn>; but you are not creating that in the code that i see here. these lines:
if ($products->fields['products_model'] != '') {
$gtin = $dom->createElement('g:gtin');
$gtin->appendChild($dom->createCDATASection($this->google_base_xml_sanitizer($products->fields['products_model'])));
$item->appendChild($gtin);
would more appropriately be:
if ($products->fields['products_model'] != '') {
$mpn = $dom->createElement('g:mpn');
$mpn->appendChild($dom->createCDATASection($this->google_base_xml_sanitizer($products->fields['products_model'])));
$item->appendChild($mpn);
}
you can reuse the variable $gtin, but for product model, it looks like you need g:mpn in the createElement line....
again, i am not sure how you got the output that you did based on the code supplied, but i would definitely look into the closing curly braces to start and some of the other things i mentioned.
hope that helps.