/**
  * build out the dom document with the supplied feed data.
  *
  * @param EbayEnterprise_Catalog_Model_Pim_Product_Collection $pimProducts collection of PIM Product instances
  * @return EbayEnterprise_Dom_Document dom document representing the feed
  */
 protected function _createDomFromFeedData(EbayEnterprise_Catalog_Model_Pim_Product_Collection $pimProducts)
 {
     $config = $this->_getFeedConfig();
     $this->_startDocument();
     $doc = $this->_doc;
     $pimRoot = $doc->documentElement;
     $itemNode = $config[self::KEY_ITEM_NODE];
     foreach ($pimProducts->getItems() as $pimProduct) {
         $itemFragment = $this->_buildItemNode($pimProduct, $itemNode);
         if ($itemFragment->hasChildNodes()) {
             $pimRoot->appendChild($itemFragment);
         }
     }
     if (Mage::helper('eb2ccore')->parseBool($config[self::KEY_IS_VALIDATE])) {
         $this->_validateDocument();
     }
     return $doc;
 }