you can get directly HTML,XML format of your resultset by just executing the query by following syntax.
uttam@uttam:~$ mysql -u[userName]
where -H is to get HTML resultset.you can replace this with -X to get XML output.
-e is to execute the query specified.
go to the shell promt. and thry this example.
mysql -uroot -p -H -e "select * from user" mysql