Update to use only one xQuery