Query service ejb test

Hi Gunter.  This is the fix for the broken unit-tests that you mentioned last week. You might notice that I refactored some of the code in QueryServiceEJB to

A) make unit-testing easier by
B) reducing duplication and 
C) breaking the logic into smaller less-complex methods.

While writing the tests, I noticed some questionable logic.  I wrote a note to you on that, and I'll point out the code here.
These static inner classes represent the refactored code that I mentioned.  I moved code from the calculateXQueryAttributes methods into these classes, which allows more code to be shared and for simplification of the calculateXQueryAttributes methods.