Google Merchant Data Feed for Magento written in PHP using DOM Document XML, this script is provided as is, and will need modification prior to use, it has been published purely as an example and is not for commercial use.
There is a detailed explanation of this script at: http://www.apwtrading.co.uk/google-merchant-php-magento-product-data-feed/