in reply to mapping between XML & DB Schemas
The mysql command can be used to generate XML of a query -- you could also use something like XML::Simple to easily dump the result of a query; you can then use XSLT (if you want, there are modules for that) to transform that XML output into XML compliant with your XSD.
XML transformation via XSLT is the "right way" to do it, if we mean by "right way": "in accordance with the standards documents and theory". There are other definitions. ;-)
For example, you might check out XML::Generator::DBI, which generates SAX events (which you can handle to with XML::SAX::Writer, for example) from DBI queries.
Based on some guesses from your description, you might also consider XML::Template for writing, and the XML::Template::DBI to serve as a data source for your template.
Ramblings and references
“A positive attitude may not solve all your problems, but it will annoy enough people to make it worth the effort.” — Herm Albright
I haven't found a problem yet that can't be solved by a well-placed trebuchet