You can import data from an XML file by creating a new data connection
and you'll need to use the Paper Forms barcode. Be aware that use of the
paper forms barcode requires LiveCycle Barcoded Forms (separate license
required, according to the pop up when I place the field in a form).
Once you set the data connection it's just a matter of writing a script
to sift through the XML values one at a time to get the barcode.