in reply to XML file as database
You might want to look at Berkeley DB XML which has a Perl API. In principle it allows you to store arbitrary XML data. The drawback might be that it doesn't support a DBD interface at present, but this might not matter for your application.
/J\
|
|---|