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
#Tamino#webMethods#API-Management