you are not missing any blocks of code. But i was able to find this error when it is trying to create the xml file:
<br />
<b>Warning</b>: DOMDocument::load() [<a href='plugins/domdocument.load'>domdocument.load</a>]: Document is empty in /home/rmgoorg/public_html/merchant/_promaps_cache/_promaps_geocache.xml, line: 1 in <b>/home/rmgoorg/public_html/merchant/google_javascript/promaps_geocache_php.php</b> on line <b>21</b><br />
<br />
<b>Warning</b>: DOMDocument::load() [<a href='plugins/domdocument.load'>domdocument.load</a>]: Start tag expected, '<' not found in /home/rmgoorg/public_html/merchant/_promaps_cache/_promaps_geocache.xml, line: 1 in <b>/home/rmgoorg/public_html/merchant/google_javascript/promaps_geocache_php.php</b> on line <b>21</b><br />
<br />
<b>Fatal error</b>: Call to a member function appendChild() on a non-object in <b>/home/rmgoorg/public_html/merchant/google_javascript/promaps_geocache_php.php</b> on line <b>36</b><br />
I'm not sure exactly the meaning of the error, but to start, could you tell me the PHP version you are using (4 or 5)?