The placement of the where clause in a query affects processing. For example, this query selects all the books whose author’s first name is Mary:
select com.sybase.xml.xql.Xql.query ("/bookstore/book[author/first-name ='Mary']", xmlcol) from XMLDAT where com.sybase.xml.xql.Xql.query ("/bookstore/book [author/first-name= ‘Mary’]", xmlcol)!= convert(com.sybase.xml.xql.Xql, null)>>EmptyResult <xql_result ><book style="textbook"> <title>History of Trenton</title> <author> <first-name>Mary</first-name> <last-name>Bob</last-name> <publication> Selected Short Stories of <first-name>Mary</first-name> <last-name>Bob</last-name> </publication> </author> <price>55</price> </book></xql_result>