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.
FOR $b IN document("http://www.bn.com/bib.xml")//book, $e IN $b/*[contains(string(.), "Suciu")] WHERE ends_with(name($e), "or") RETURN <book> $b/title, $e </book>
Adapted from XML Query Use Cases