...lational plan and the original query, we make sure these forecasts are valuable even if the evaluation strategy of the actual back-end is not relational. Consider the following XQuery query against weather.com forecast data for New Zealand (which we hope takes the else branch more often than the then branch during VLDB 2008): for $d in doc ("forecast.xml")/descendant::day 1© let $day := $d/@t let $ppcp := data ($d/descendant::ppcp) return if ($ppcp > 50) then ("rain likely on", $day, "chance of precipitation:", $ppcp) 3© else ("no rain on", $day) 4© 2© (Q1) Although existing techniques (e.g., [1, 6, 15]) could well estimate the cardinality of the rooted path expression doc (·)/ descendant::day, the remaining expression kinds in this query (for loops, conditionals, sequence construction, and implicit existential quantification), let alone the arbitrary nesting of such clauses, are beyond the capabilities of existing work. It is our goal to derive accurate cardinality estimates for any subexpression in this query, and we will illustrate our approach for the ones marked 1© to 4©. Interlude: The importance of cardinality forecasts. To pinpoint the impact of such fine-grained cardinality forecast...