It just takes one step. What you need to do is use the mysqldump program. Execute the program with the option -X or --xml. Here's an example:
Code:
mysqldump -X test > test.xml
This dumps the test database into the test.xml file in XML format. You may need to provide a username and password, if your database requires it. If you need more information, check out the manual.
http://www.mysql.com/doc/en/mysqldump.html