从php中的3个表创建xml

I have 3 Tables, 2 Tables from 1 Database and 1 Table from other Database.

Database "GER":
Tables:
1. account
fields:
- accountid
- accountname
2. accountbillads
fields:
- accountaddressid
- bill_city
- bill_street

Database "STG":
Table:
1. edata
fields:
- deviceid
- lat
- long

Field "accountid" and "accountaddressid" have the same data.
Field "accountname" and "deviceid" have the same data.

How i may to create XML file with this structure in PHP ?

  <?xml version="1.0" encoding="utf-8"?>
<markers>
<marker accountid="13" accountname="alex" bill_city="london" bill_street="knighton 13" lat="23.456" long="13.456"/>
</markers>

any reference will help me. thanks

first of all your must have access to both databases. If you haven't done already, take a look at the GRANT syntax in mysql manual.

After setting correct permissions, you execute your normal queries, using db/tablenames.

For example: SELECT ger.account.accountid FROM ger.account WHERE ...

Grant syntax: http://dev.mysql.com/doc/refman/5.1/en/grant.html

Select syntax: http://dev.mysql.com/doc/refman/5.0/en/select.html

After that, you use php to retrieve data as you want them from both databses to create your xml document