Check the full post for an example
Like the real Napster in the movie The Italian Job (the remake), XQuery might have a bit of a chip on its shoulder about the X in AJAX.
Sure, it stands for XML since the idea is that return an XML fragment to the browser to update content in a div, fill in form fields or even create drop down menu options on the fly.
But how do you create that XML? Using static XML files works, but the whole idea is to dynamically respond to user actions and give them information without reloading the whole page.
And what's the best way to dynamically create XML? XQuery of course!