Pretty sure you want to use the .exist() method. Check out his blog post about it: http://www.jasonstrate.com/2010/11/xquery-for-the-non-expert-exist/
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question