The third-party Order Desk integration has a built-in version of this script that will let you cache the XML for a transaction and then resubmit it to a location of your choosing with no coding necessary.
The purpose of this file is to help you set up and debug your FoxyCart XML DataFeed scripts. It's designed to mimic FoxyCart.com and send encrypted and encoded XML to a URL of your choice. It will print out the response that your script gives back, which should be “foxy” if successful.
Check the comments in the file.
short_open_tag
enabled in php.ini or change the PHP open tag from <?
to <?php