Hi Tibor,
Looks like your object is calling a function like ajax call and yes as Christian mentioned asynchronously, so i only when it completes entire executtion, it leaves the page and goes for the URL. Check if loadxml() has a parameter to turn it into synchronous call.
Best Regards
Swaroop