Yes - I think that is the best way. Once you get the file at
http://p-treasures.com/banner.php to work - then you know you have the parameters & paths set up correctly. Then - drop that code into the XCART templates - which you have already figured out.
Your other option - which would be messier - is to get rid of the banner subdirectory and move all the code inside to the top level.
You might look for guidance in the documentation for the script/flash, or , if they gave you the flash source, you can see in the actionscript how they are referencing the xml file. Usually - they will try and give you information about properly setting up paths to the xml. This all has to be set up correctly for such scripts/flash to work properly. The flash has to be able to find the xml file.