Find books in which some element has a tag ending in "or" and the same element contains the string "Suciu" (at any level of nesting). For each such book, return the title and the qualifying element.
<result>
for $b in document("bib.xml")//book,
$e in $b/*[contains(string(.), "Suciu")]
where ends_with(name($e), "or")
return
<book>
{ $b/title} { $e }
</book>
</result>
Not supported by Quip yet
Adapted from XML Query Use Cases