This should be done rather easily via the API2 MysqlFE::listdbs call. To call this you would use a URL like:
Code:
/xml-api/cpanel?cpanel_xmlapi_module=MysqlFE&cpanel_xmlapi_func=listdbs&cpanel_xmlapi_user=$username
. At this point, it should return an XML list of the databases that belong to that user and you can kick off a "dump" process from there.
There are a few libraries that can assist you with this, please see http://github.com/CpanelInc for a listing of them (perl and PHP)
Please let me know if you have any more questions/problems that we can assist you with.