The filtering mechanism for XQuery has some differences and specifications when compared to the T-SQL WHERE clause. In my experience, when DBAs and Developers implement filters for XQuery, it is mostly based on a T-SQL strategy or to create dynamic SQL that is not efficient and could be very difficult to maintain, especially when the filter is implemented as dynamic SQL. This chapter will demonstrate many examples of how to implement filters for XQuery requests.
6-1. Implementing the exist( ) Method
Problem
You want to determine whether a specific element or attribute exists ...