Turn SQL query into XML structure for further processing.