Extended query api.
Fixed some bugs with the load xml solutions.