nested If then statements in XQuery

Hi I have an XML file

USA
CA
LA
USA
CA
San Jose

I need to query this XML file according to Country, State and City.Can I use nested IF Then statements in XQuery? There might be many cities under particular State and I need the output xml file to have the city which the user queried for along with the state and country included in it.
Help needed please.
Thank You
Kulkarni

Hi Anyone please help me with the above problem I tried doing it but cudnt get expected results… please help needed…
Thank You
Kulkarni

The XQuery language allows nested if-then-else statements, but this isn’t implemented yet in Tamino. But I can’t see why you think you need it for this query.

Your XML structure consists of repeated groups of Country/State/City elements, with no containing element around the three elements in the group. This is a really difficult structure to process using XQuery (or XSLT for that matter). You would make life much easier for yourself if you wrap each group in a containing element.

Michael Kay