unless I'm missing something that doesn't look like the type of query dovecot launches - dovecot sends various parameters including the request for xml results. The thing that looks odd to me is that the results fields should be single values not arrays enclosed in [], ie I would have expected
"uid":21, instead of "uid":[21],I'd be interested to see the equivalent xml output produced by running a query that dovecot sends.