minor modifications to the query script, now a single xml is outputted
minor changes