I am trying to create a feed for Google Merchant using php and DOM document.The feed contains thousands of items, yet fails to validate because there are a tiny handful of cases(4/5 out of 6000+) where the XML is malformed, for example:\[code\] <groduct_type>Plantsgroduct_type>\[/code\]I am generating in a foreach loop\[code\] //Loop through each plant foreach($plantList as $plantItem){ //begin item element $item = $xml->createElement('item'); //Loop through use key as element name and value as data foreach ($plantItem as $key => $value) { //Decode HTML characters, for example '&' becomes & //to comply with http://www.w3.org/TR/xhtml1/#C_12 $decode = htmlspecialchars_decode($value); $decode = trim($decode); if(empty($decode)) continue; //Create the element $tag = $xml->createElement($key); $tag = $item->appendChild($tag); //Write the field $text = $xml->createTextNode($decode); $text = $tag->appendChild($text); } $item = $channel->appendChild($item); }\[/code\]Here is the xml entire generation code.Here are the 3 malformed tags:\[code\]g:adwords_grouping>18</g:adwords_grouping>form>10 ltr pot</form>title>Buy Helleborus x nigercors</title>\[/code\]The malformed tags pop up in different places when I make adjusments to the code. Usually its either missing '