I think the Adobe calls an XMP template what you're calling an XMP data file. Here's a sample.
Is there an easy way to apply that data from the Perl library? I'm writing my own script and don't want to shell out unless I can help it.