...
/bookstore/categories[@code="1"]/books[@title="Matilda"]
The new approach will first look used nested sub-queries to search for each path component, first looking for "bookstore", and using that as the parent node, look for ''categories[@code='1']", and using that as parent, look for "books" or an xpath component starting with "books[" , before finally applying leaf condition checks.
...