Hi, I think this is where the problem lies.
As far as I am aware, everything most be done in a sequence, you can't branch off.
from results.php, you can go to detail.php or you can go to menu.php
passing the url variable will work in either case but I don't know of a way that you can generate the xml on the fly and then go to detail.php automatically.
Maybe someone from WA can offer a solution. Sorry.