My first thought is why is the xml being created 'on the fly'.
i have created a few flash files which use xml as a data source, but in these instances, the xml file i want to use already exists.
if you have a large number of flash files, then this could be an issue, (see potentially neater solution below), but if you only have a few then why not have several xml files in place, the one you use is dependent on the detailid.
As Jason suggested, you could then use a php require statement to select the appropriate xml file, which, I think, will work so long as the xml file exists.
for example, say the detailid = 3 and you want to use the xml file menu3.xml
<?php require_once("menu".$_GET['detailid'].".xml"); ?>
which when run would be
<?php require_once("menu3.xml"); ?>
Another (neater) idea I have, though untested for your solution, is to have your xml (unfiltered) data in menu.php bound to your details page as a spry dataset.
You can then filter this dataset depending upon the detailid in the URL parameter
This option certainly works with data, so in principle you should be able to set the parameters of your flash file with dataset data instead of recordset data.