You sould read the online manual that contains all the proper procedures, but where's how you can do it:
<?php
include("xmlapi.php");
$db_host = "localhost";
$cpuser = "myuser";
$databasename = 'mydatabasename';//do not prepend with username
$databaseuser = 'mydatabaseuser';//api will do that for you
$databasepass = '123456';
$xmlapi = new xmlapi($db_host);
$xmlapi->password_auth("root","root_pass");
$xmlapi->set_debug(1);//this setting will put output into the error log in the directory that you are calling script from
$xmlapi->set_output('array');//set this for browser output
//create database
$createdb = $xmlapi->api1_query($cpuser, "Mysql", "adddb", array($databasename));
foreach($createdb as $v)
{
$result = $v['result'];
}
if ($result == 1)
{
//create user
$usr = $xmlapi->api1_query($cpuser, "Mysql", "adduser", array($databaseuser, $databasepass));
}
foreach($usr as $v)
{
$result2 = $v['result'];
}
if ($result2 == 1)
{
//add user to database
$addusr = $xmlapi->api1_query($cpuser, "Mysql", "adduserdb", array($databasename, $databaseuser, 'all'));
}
print_r($addusr);
?>
This should be adapted to your API, but what it does is allow the DB creation, with a user creation, and finally, associate then!
Ps: see xmlapi-php-class
Hope it helps you...