xQuery return all values but one <p>Here is my xml:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;library xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="library.xsd"&gt; &lt;items&gt; &lt;book asin="0201100886" created="128135928" lastLookupTime="128135928"&gt; &lt;uuid&gt;BA57A934-6CDC-11D9-830B-000393D3DE16&lt;/uuid&gt; &lt;title&gt;Compilers&lt;/title&gt; &lt;authors&gt; &lt;author&gt;Alfred V. Aho&lt;/author&gt; &lt;author&gt;Ravi Sethi&lt;/author&gt; &lt;author&gt;Jeffrey D. Ullman&lt;/author&gt; &lt;/authors&gt; &lt;publisher&gt;Addison Wesley&lt;/publisher&gt; &lt;published&gt;1986-01-01&lt;/published&gt; &lt;price&gt;102.00&lt;/price&gt; &lt;purchaseDate&gt;2005-01-22&lt;/purchaseDate&gt; &lt;/book&gt; &lt;book asin="0122513363" created="128135600" lastLookupTime="128136224"&gt; &lt;uuid&gt;F7468E09-6CDB-11D9-830B-000393D3DE16&lt;/uuid&gt; &lt;title&gt;Database Driven Web Sites&lt;/title&gt; &lt;authors&gt; &lt;author&gt;Jesse Feiler&lt;/author&gt; &lt;/authors&gt; &lt;publisher&gt;Morgan Kaufmann&lt;/publisher&gt; &lt;published&gt;1998-04-15&lt;/published&gt; &lt;edition&gt;Paperback&lt;/edition&gt; &lt;price&gt;50.95&lt;/price&gt; &lt;purchaseDate&gt;2005-01-22&lt;/purchaseDate&gt; &lt;currentValue&gt;35.00&lt;/currentValue&gt; &lt;netRating&gt;1.5&lt;/netRating&gt; &lt;genres&gt; &lt;genre&gt;Computer Bks - Internet&lt;/genre&gt; &lt;genre&gt;Computer Books: Web Programming&lt;/genre&gt; &lt;genre&gt;Computer Networks&lt;/genre&gt; &lt;genre&gt;Computers&lt;/genre&gt; &lt;genre&gt;Database Management - General&lt;/genre&gt; &lt;genre&gt;Database management&lt;/genre&gt; &lt;genre&gt;Design&lt;/genre&gt; &lt;genre&gt;Distributed Databases&lt;/genre&gt; &lt;genre&gt;Information Technology&lt;/genre&gt; &lt;genre&gt;Internet - Web Site Design&lt;/genre&gt; &lt;genre&gt;Networking - General&lt;/genre&gt; &lt;genre&gt;Web sites&lt;/genre&gt; &lt;genre&gt;Computers / Computer Science&lt;/genre&gt; &lt;/genres&gt; &lt;upc&gt;608628133638&lt;/upc&gt; &lt;/book&gt; &lt;book asin="0201441241" created="128136896" lastLookupTime="128136896"&gt; &lt;uuid&gt;FBC45DF4-6CDE-11D9-830B-000393D3DE16&lt;/uuid&gt; &lt;title&gt;Introduction to Automata Theory, Languages, and Computation (2nd Edition)&lt;/title&gt; &lt;authors&gt; &lt;author&gt;John E. Hopcroft&lt;/author&gt; &lt;author&gt;Rajeev Motwani&lt;/author&gt; &lt;author&gt;Jeffrey D. Ullman&lt;/author&gt; &lt;/authors&gt; &lt;publisher&gt;Addison Wesley&lt;/publisher&gt; &lt;published&gt;2000-11-14&lt;/published&gt; &lt;price&gt;108.20&lt;/price&gt; &lt;purchaseDate&gt;2005-01-22&lt;/purchaseDate&gt; &lt;/book&gt; &lt;book asin="0471250600" created="128136896" lastLookupTime="128136896"&gt; &lt;uuid&gt;FBC7CA56-6CDE-11D9-830B-000393D3DE16&lt;/uuid&gt; &lt;title&gt;Operating System Concepts&lt;/title&gt; &lt;authors&gt; &lt;author&gt;Abraham Silberschatz&lt;/author&gt; &lt;author&gt;Greg Gagne&lt;/author&gt; &lt;author&gt;Peter Baer Galvin&lt;/author&gt; &lt;/authors&gt; &lt;publisher&gt;Wiley&lt;/publisher&gt; &lt;published&gt;2002-03-08&lt;/published&gt; &lt;price&gt;107.95&lt;/price&gt; &lt;purchaseDate&gt;2005-01-22&lt;/purchaseDate&gt; &lt;/book&gt; &lt;book asin="0321193628" created="128136896" lastLookupTime="128136896"&gt; &lt;uuid&gt;FBCB3DCF-6CDE-11D9-830B-000393D3DE16&lt;/uuid&gt; &lt;title&gt;Concepts of Programming Languages, Sixth Edition&lt;/title&gt; &lt;authors&gt; &lt;author&gt;Robert W. Sebesta&lt;/author&gt; &lt;/authors&gt; &lt;publisher&gt;Addison Wesley&lt;/publisher&gt; &lt;published&gt;2003-07-24&lt;/published&gt; &lt;price&gt;112.40&lt;/price&gt; &lt;purchaseDate&gt;2005-01-22&lt;/purchaseDate&gt; &lt;/book&gt; &lt;book asin="0138613370" created="128136944" lastLookupTime="128136944"&gt; &lt;uuid&gt;19E5E602-6CDF-11D9-830B-000393D3DE16&lt;/uuid&gt; &lt;title&gt;First Course in Database Systems, A&lt;/title&gt; &lt;authors&gt; &lt;author&gt;Jeffrey D. Ullman&lt;/author&gt; &lt;author&gt;Jennifer Widom&lt;/author&gt; &lt;/authors&gt; &lt;publisher&gt;Prentice Hall&lt;/publisher&gt; &lt;published&gt;1997-04-02&lt;/published&gt; &lt;edition&gt;Hardcover&lt;/edition&gt; &lt;price&gt;67.00&lt;/price&gt; &lt;purchaseDate&gt;2005-01-22&lt;/purchaseDate&gt; &lt;netRating&gt;3.2&lt;/netRating&gt; &lt;genres&gt; &lt;genre&gt;Computer Books: Database&lt;/genre&gt; &lt;genre&gt;Computers&lt;/genre&gt; &lt;genre&gt;Database Engineering&lt;/genre&gt; &lt;genre&gt;Database Management - General&lt;/genre&gt; &lt;genre&gt;Database management&lt;/genre&gt; &lt;/genres&gt; &lt;recommendations&gt; &lt;book asin="0130402648" created="128136952" lastLookupTime="128136952"&gt; &lt;uuid&gt;1C60074A-6CDF-11D9-830B-000393D3DE16&lt;/uuid&gt; &lt;title&gt;Database System Implementation&lt;/title&gt; &lt;authors&gt; &lt;author&gt;Hector Garcia-Molina&lt;/author&gt; &lt;author&gt;Jeffrey D. Ullman&lt;/author&gt; &lt;author&gt;Jennifer D. Widom&lt;/author&gt; &lt;/authors&gt; &lt;publisher&gt;Prentice Hall&lt;/publisher&gt; &lt;published&gt;1999-06-11&lt;/published&gt; &lt;price&gt;89.00&lt;/price&gt; &lt;purchaseDate&gt;2005-01-22&lt;/purchaseDate&gt; &lt;/book&gt; &lt;book asin="0130319953" created="128136952" lastLookupTime="128136952"&gt; &lt;uuid&gt;1C635DB0-6CDF-11D9-830B-000393D3DE16&lt;/uuid&gt; &lt;title&gt;Database Systems: The Complete Book&lt;/title&gt; &lt;authors&gt; &lt;author&gt;Hector Garcia-Molina&lt;/author&gt; &lt;author&gt;Jeffrey D. Ullman&lt;/author&gt; &lt;author&gt;Jennifer D. Widom&lt;/author&gt; &lt;/authors&gt; &lt;publisher&gt;Prentice Hall&lt;/publisher&gt; &lt;published&gt;2001-10-02&lt;/published&gt; &lt;price&gt;98.00&lt;/price&gt; &lt;purchaseDate&gt;2005-01-22&lt;/purchaseDate&gt; &lt;/book&gt; &lt;book asin="0201976994" created="128136952" lastLookupTime="128136952"&gt; &lt;uuid&gt;1C66B7B4-6CDF-11D9-830B-000393D3DE16&lt;/uuid&gt; &lt;title&gt;Computer Networking: A Top-Down Approach Featuring the Internet&lt;/title&gt; &lt;authors&gt; &lt;author&gt;James F. Kurose&lt;/author&gt; &lt;author&gt;Keith W. Ross&lt;/author&gt; &lt;author&gt;James Kurose&lt;/author&gt; &lt;author&gt;Keith Ross&lt;/author&gt; &lt;/authors&gt; &lt;publisher&gt;Addison Wesley&lt;/publisher&gt; &lt;published&gt;2002-07-17&lt;/published&gt; &lt;price&gt;100.00&lt;/price&gt; &lt;purchaseDate&gt;2005-01-22&lt;/purchaseDate&gt; &lt;/book&gt; &lt;book asin="0131433512" created="128136952" lastLookupTime="128136952"&gt; &lt;uuid&gt;1C6AC88C-6CDF-11D9-830B-000393D3DE16&lt;/uuid&gt; &lt;title&gt;Computer Networks and Internets, Fourth Edition&lt;/title&gt; &lt;authors&gt; &lt;author&gt;Douglas E Comer&lt;/author&gt; &lt;author&gt;Ralph E. Droms&lt;/author&gt; &lt;/authors&gt; &lt;publisher&gt;Prentice Hall&lt;/publisher&gt; &lt;published&gt;2003-07-28&lt;/published&gt; &lt;price&gt;100.00&lt;/price&gt; &lt;purchaseDate&gt;2005-01-22&lt;/purchaseDate&gt; &lt;/book&gt; &lt;book asin="0262062178" created="128136952" lastLookupTime="128136952"&gt; &lt;uuid&gt;1C6E712C-6CDF-11D9-830B-000393D3DE16&lt;/uuid&gt; &lt;title&gt;Essentials of Programming Languages - 2nd Edition&lt;/title&gt; &lt;authors&gt; &lt;author&gt;Daniel P. Friedman&lt;/author&gt; &lt;author&gt;Mitchell Wand&lt;/author&gt; &lt;author&gt;Christopher T. Haynes&lt;/author&gt; &lt;/authors&gt; &lt;publisher&gt;The MIT Press&lt;/publisher&gt; &lt;published&gt;2001-01-29&lt;/published&gt; &lt;price&gt;62.00&lt;/price&gt; &lt;purchaseDate&gt;2005-01-22&lt;/purchaseDate&gt; &lt;/book&gt; &lt;book asin="0471250600" created="128136952" lastLookupTime="128136952"&gt; &lt;uuid&gt;1C71B23E-6CDF-11D9-830B-000393D3DE16&lt;/uuid&gt; &lt;title&gt;Operating System Concepts&lt;/title&gt; &lt;authors&gt; &lt;author&gt;Abraham Silberschatz&lt;/author&gt; &lt;author&gt;Greg Gagne&lt;/author&gt; &lt;author&gt;Peter Baer Galvin&lt;/author&gt; &lt;/authors&gt; &lt;publisher&gt;Wiley&lt;/publisher&gt; &lt;published&gt;2002-03-08&lt;/published&gt; &lt;price&gt;107.95&lt;/price&gt; &lt;purchaseDate&gt;2005-01-22&lt;/purchaseDate&gt; &lt;/book&gt; &lt;book asin="0137903952" created="128136952" lastLookupTime="128136952"&gt; &lt;uuid&gt;1C764AD4-6CDF-11D9-830B-000393D3DE16&lt;/uuid&gt; &lt;title&gt;Artificial Intelligence: A Modern Approach (2nd Edition)&lt;/title&gt; &lt;authors&gt; &lt;author&gt;Stuart J. Russell&lt;/author&gt; &lt;author&gt;Peter Norvig&lt;/author&gt; &lt;/authors&gt; &lt;publisher&gt;Prentice Hall&lt;/publisher&gt; &lt;published&gt;2002-12-20&lt;/published&gt; &lt;price&gt;93.33&lt;/price&gt; &lt;purchaseDate&gt;2005-01-22&lt;/purchaseDate&gt; &lt;/book&gt; &lt;book asin="155860832X" created="128136952" lastLookupTime="128136952"&gt; &lt;uuid&gt;1C898640-6CDF-11D9-830B-000393D3DE16&lt;/uuid&gt; &lt;title&gt;Computer Networks: A Systems Approach, 3rd Edition&lt;/title&gt; &lt;authors&gt; &lt;author&gt;Larry L. Peterson&lt;/author&gt; &lt;author&gt;Bruce S. Davie&lt;/author&gt; &lt;/authors&gt; &lt;publisher&gt;Morgan Kaufmann&lt;/publisher&gt; &lt;published&gt;2003-05-22&lt;/published&gt; &lt;price&gt;89.95&lt;/price&gt; &lt;purchaseDate&gt;2005-01-22&lt;/purchaseDate&gt; &lt;/book&gt; &lt;book asin="0130669474" created="128136952" lastLookupTime="128136952"&gt; &lt;uuid&gt;1C8DD37A-6CDF-11D9-830B-000393D3DE16&lt;/uuid&gt; &lt;title&gt;SQL Fundamentals (2nd Edition)&lt;/title&gt; &lt;authors&gt; &lt;author&gt;John J. Patrick&lt;/author&gt; &lt;/authors&gt; &lt;publisher&gt;Prentice Hall PTR&lt;/publisher&gt; &lt;published&gt;2002-05-07&lt;/published&gt; &lt;price&gt;54.99&lt;/price&gt; &lt;purchaseDate&gt;2005-01-22&lt;/purchaseDate&gt; &lt;/book&gt; &lt;book asin="0321122267" created="128136952" lastLookupTime="128136952"&gt; &lt;uuid&gt;1C91D772-6CDF-11D9-830B-000393D3DE16&lt;/uuid&gt; &lt;title&gt;Fundamentals of Database Systems, Fourth Edition&lt;/title&gt; &lt;authors&gt; &lt;author&gt;Ramez Elmasri&lt;/author&gt; &lt;author&gt;Shamkant B. Navathe&lt;/author&gt; &lt;/authors&gt; &lt;publisher&gt;Addison Wesley&lt;/publisher&gt; &lt;published&gt;2003-07-23&lt;/published&gt; &lt;price&gt;104.20&lt;/price&gt; &lt;purchaseDate&gt;2005-01-22&lt;/purchaseDate&gt; &lt;/book&gt; &lt;/recommendations&gt; &lt;/book&gt; &lt;book asin="1558604820" created="128136024" lastLookupTime="128136024"&gt; &lt;uuid&gt;F3C7B24F-6CDC-11D9-830B-000393D3DE16&lt;/uuid&gt; &lt;title&gt;A Complete Guide to DB2 Universal Database&lt;/title&gt; &lt;authors&gt; &lt;author&gt;D. D. Chamberlin&lt;/author&gt; &lt;author&gt;Don Chamberlin&lt;/author&gt; &lt;/authors&gt; &lt;publisher&gt;Morgan Kaufmann&lt;/publisher&gt; &lt;published&gt;1998-08-15&lt;/published&gt; &lt;edition&gt;Paperback&lt;/edition&gt; &lt;price&gt;62.95&lt;/price&gt; &lt;purchaseDate&gt;2005-01-22&lt;/purchaseDate&gt; &lt;netRating&gt;4.4&lt;/netRating&gt; &lt;genres&gt; &lt;genre&gt;Computer Bks - Data Base Management&lt;/genre&gt; &lt;genre&gt;Computer Books: Database&lt;/genre&gt; &lt;genre&gt;Computers&lt;/genre&gt; &lt;genre&gt;Database Management - General&lt;/genre&gt; &lt;genre&gt;General&lt;/genre&gt; &lt;genre&gt;IBM Database 2&lt;/genre&gt; &lt;genre&gt;Information Storage &amp;amp; Retrieval&lt;/genre&gt; &lt;genre&gt;Relational Databases&lt;/genre&gt; &lt;genre&gt;Computers / Information Storage &amp;amp; Retrieval&lt;/genre&gt; &lt;/genres&gt; &lt;recommendations&gt; &lt;book asin="0072133449" created="128136024" lastLookupTime="128136024"&gt; &lt;uuid&gt;F6B35F21-6CDC-11D9-830B-000393D3DE16&lt;/uuid&gt; &lt;title&gt;DB2: The Complete Reference (Complete Reference Series)&lt;/title&gt; &lt;authors&gt; &lt;author&gt;Roman B. Melnyk&lt;/author&gt; &lt;author&gt;Paul C. Zikopoulos&lt;/author&gt; &lt;/authors&gt; &lt;publisher&gt;McGraw-Hill Companies&lt;/publisher&gt; &lt;published&gt;2001-10-01&lt;/published&gt; &lt;price&gt;59.99&lt;/price&gt; &lt;purchaseDate&gt;2005-01-22&lt;/purchaseDate&gt; &lt;/book&gt; &lt;book asin="0130661112" created="128136024" lastLookupTime="128136024"&gt; &lt;uuid&gt;F6B97E54-6CDC-11D9-830B-000393D3DE16&lt;/uuid&gt; &lt;title&gt;DB2 UDB v8 Handbook for Windows and UNIX/Linux&lt;/title&gt; &lt;authors&gt; &lt;author&gt;Philip K. Gunning&lt;/author&gt; &lt;/authors&gt; &lt;publisher&gt;Prentice Hall PTR&lt;/publisher&gt; &lt;published&gt;2003-08-06&lt;/published&gt; &lt;price&gt;59.99&lt;/price&gt; &lt;purchaseDate&gt;2005-01-22&lt;/purchaseDate&gt; &lt;/book&gt; &lt;book asin="0131007726" created="128136024" lastLookupTime="128136024"&gt; &lt;uuid&gt;F6BCBB88-6CDC-11D9-830B-000393D3DE16&lt;/uuid&gt; &lt;title&gt;DB2 SQL Procedural Language for Linux, Unix and Windows&lt;/title&gt; &lt;authors&gt; &lt;author&gt;Paul Yip&lt;/author&gt; &lt;author&gt;Drew Bradstock&lt;/author&gt; &lt;author&gt;Hana Curtis&lt;/author&gt; &lt;author&gt;Michael Gao&lt;/author&gt; &lt;author&gt;Zamil Janmohamed&lt;/author&gt; &lt;author&gt;Clara Liu&lt;/author&gt; &lt;author&gt;Fraser McArthur&lt;/author&gt; &lt;/authors&gt; &lt;publisher&gt;Prentice Hall PTR&lt;/publisher&gt; &lt;published&gt;2002-12-24&lt;/published&gt; &lt;price&gt;59.99&lt;/price&gt; &lt;purchaseDate&gt;2005-01-22&lt;/purchaseDate&gt; &lt;/book&gt; &lt;book asin="0131424653" created="128136024" lastLookupTime="128136024"&gt; &lt;uuid&gt;F6C0A296-6CDC-11D9-830B-000393D3DE16&lt;/uuid&gt; &lt;title&gt;DB2 UDB V8.1 Certification Exam 700 Study Guide&lt;/title&gt; &lt;authors&gt; &lt;author&gt;Roger E. Sanders&lt;/author&gt; &lt;/authors&gt; &lt;publisher&gt;Prentice Hall PTR&lt;/publisher&gt; &lt;published&gt;2003-09-17&lt;/published&gt; &lt;price&gt;49.99&lt;/price&gt; &lt;purchaseDate&gt;2005-01-22&lt;/purchaseDate&gt; &lt;/book&gt; &lt;book asin="0764508415" created="128136024" lastLookupTime="128136024"&gt; &lt;uuid&gt;F6C4058C-6CDC-11D9-830B-000393D3DE16&lt;/uuid&gt; &lt;title&gt;DB2 Fundamentals Certification for Dummies&lt;/title&gt; &lt;authors&gt; &lt;author&gt;Paul C. Zikopoulos&lt;/author&gt; &lt;author&gt;Jennifer Gibbs&lt;/author&gt; &lt;author&gt;Roman B. Melnyk&lt;/author&gt; &lt;/authors&gt; &lt;publisher&gt;For Dummies&lt;/publisher&gt; &lt;published&gt;2001-08-01&lt;/published&gt; &lt;price&gt;34.99&lt;/price&gt; &lt;purchaseDate&gt;2005-01-22&lt;/purchaseDate&gt; &lt;/book&gt; &lt;book asin="0130463612" created="128136024" lastLookupTime="128136024"&gt; &lt;uuid&gt;F6D9A3D8-6CDC-11D9-830B-000393D3DE16&lt;/uuid&gt; &lt;title&gt;DB2 Universal Database V8 for Linux, UNIX, and Windows Database Administration Certification Guide (5th Edition)&lt;/title&gt; &lt;authors&gt; &lt;author&gt;George Baklarz&lt;/author&gt; &lt;author&gt;Bill Wong&lt;/author&gt; &lt;/authors&gt; &lt;publisher&gt;Prentice Hall PTR&lt;/publisher&gt; &lt;published&gt;2003-02-10&lt;/published&gt; &lt;price&gt;59.99&lt;/price&gt; &lt;purchaseDate&gt;2005-01-22&lt;/purchaseDate&gt; &lt;/book&gt; &lt;book asin="0130463884" created="128136024" lastLookupTime="128136024"&gt; &lt;uuid&gt;F6DDBAB9-6CDC-11D9-830B-000393D3DE16&lt;/uuid&gt; &lt;title&gt;Advanced DBA Certification Guide and Reference for DB2 UDB v8 for Linux, Unix and Windows&lt;/title&gt; &lt;authors&gt; &lt;author&gt;Dwaine R. Snow&lt;/author&gt; &lt;author&gt;Thomas Xuan Phan&lt;/author&gt; &lt;author&gt;Dwaine Snow&lt;/author&gt; &lt;/authors&gt; &lt;publisher&gt;Prentice Hall PTR&lt;/publisher&gt; &lt;published&gt;2003-07-07&lt;/published&gt; &lt;price&gt;59.99&lt;/price&gt; &lt;purchaseDate&gt;2005-01-22&lt;/purchaseDate&gt; &lt;/book&gt; &lt;book asin="155860443X" created="128136024" lastLookupTime="128136024"&gt; &lt;uuid&gt;F6E1063D-6CDC-11D9-830B-000393D3DE16&lt;/uuid&gt; &lt;title&gt;Advanced Database Systems (The Morgan Kaufmann Series in Data Management Systems)&lt;/title&gt; &lt;authors&gt; &lt;author&gt;Carlo Zaniolo&lt;/author&gt; &lt;author&gt;Stefano Ceri&lt;/author&gt; &lt;author&gt;Christos Faloutsos&lt;/author&gt; &lt;author&gt;Richard T. Snodgrass&lt;/author&gt; &lt;author&gt;V. S. Subrahmanian&lt;/author&gt; &lt;author&gt;Roberto Zicari&lt;/author&gt; &lt;/authors&gt; &lt;publisher&gt;Morgan Kaufmann&lt;/publisher&gt; &lt;published&gt;1997-05-01&lt;/published&gt; &lt;price&gt;88.95&lt;/price&gt; &lt;purchaseDate&gt;2005-01-22&lt;/purchaseDate&gt; &lt;/book&gt; &lt;book asin="0131840487" created="128136024" lastLookupTime="128136024"&gt; &lt;uuid&gt;F6E441CE-6CDC-11D9-830B-000393D3DE16&lt;/uuid&gt; &lt;title&gt;DB2 UDB V8.1 Certification Exams 701 and 706 Study Guide&lt;/title&gt; &lt;authors&gt; &lt;author&gt;Roger E. Sanders&lt;/author&gt; &lt;/authors&gt; &lt;publisher&gt;Prentice Hall PTR&lt;/publisher&gt; &lt;published&gt;2003-12-12&lt;/published&gt; &lt;price&gt;49.99&lt;/price&gt; &lt;purchaseDate&gt;2005-01-22&lt;/purchaseDate&gt; &lt;/book&gt; &lt;book asin="0132037955" created="128136024" lastLookupTime="128136024"&gt; &lt;uuid&gt;F6E77C2C-6CDC-11D9-830B-000393D3DE16&lt;/uuid&gt; &lt;title&gt;DB2 High Performance Design and Tuning&lt;/title&gt; &lt;authors&gt; &lt;author&gt;Richard Yevich&lt;/author&gt; &lt;author&gt;Susan Lawson&lt;/author&gt; &lt;author&gt;Richard A. Yevich&lt;/author&gt; &lt;/authors&gt; &lt;publisher&gt;Prentice Hall PTR&lt;/publisher&gt; &lt;published&gt;2000-08-24&lt;/published&gt; &lt;price&gt;54.99&lt;/price&gt; &lt;purchaseDate&gt;2005-01-22&lt;/purchaseDate&gt; &lt;/book&gt; &lt;/recommendations&gt; &lt;/book&gt; &lt;/items&gt; &lt;borrowers&gt; &lt;borrower id="1"&gt; &lt;name&gt; John Doe &lt;/name&gt; &lt;phone&gt; 555-1212 &lt;/phone&gt; &lt;borrowed&gt; &lt;book asin="0138613370"/&gt; &lt;book asin="0122513363"/&gt; &lt;/borrowed&gt; &lt;/borrower&gt; &lt;borrower id="2"&gt; &lt;name&gt; Mary Jane &lt;/name&gt; &lt;phone&gt; 555-1213 &lt;/phone&gt; &lt;borrowed&gt; &lt;book asin="0201100886"/&gt; &lt;book asin="0122513363"/&gt; &lt;/borrowed&gt; &lt;/borrower&gt; &lt;borrower id="3"&gt; &lt;name&gt; Bill Jones &lt;/name&gt; &lt;phone&gt; 555-1312 &lt;/phone&gt; &lt;borrowed /&gt; &lt;/borrower&gt; &lt;borrower id="4"&gt; &lt;name&gt; Anne Marie&lt;/name&gt; &lt;phone&gt; 555-1314&lt;/phone&gt; &lt;borrowed&gt; &lt;book asin="0138613370"/&gt; &lt;book asin="0201100886"/&gt; &lt;book asin="0122513363"/&gt; &lt;book asin="1558604820"/&gt; &lt;/borrowed&gt; &lt;/borrower&gt; </code></pre> <p> </p> <p>Here is my XQuery:</p> <pre><code>xquery version "1.0"; for $library in doc("library.xml")/library for $book in $library/items/book let $borrowed := $library/borrowers/borrower/borrowed/book where not($borrowed[@asin = $book/@asin]) and ($book/authors/author = "Jeffrey D. Ullman") return if($book/authors/author != "Jeffrey D. Ullman") then &lt;librarytitle&gt;{$book/authors/author}&lt;/librarytitle&gt; else &lt;librarytitle/&gt; </code></pre> <p>I need to return all authors where Jeff D Ullman is a coauthor but in the list I cant return his name. So i get all books he is an author in and print them out. If his name is there dont print it out. My if then else statement is not working. Any ideas????</p>