To select nodes in an XML document using hierarchical paths and filter predicates, an analyst uses expressions written…