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 xmlns:xf="http://www.w3.org/2001/08/xquery-operators">
FOR $b IN document("bib.xml")//book,
$e IN $b/*[contains(string(.), "Suciu")]
WHERE xf:ends_with(name($e), "or")
RETURN
<book>
{ $b/title} { $e }
</book>
</result>
Not supported by Quip yet
Adapted from XML Query Use Cases