You can export the data in XML format out of the form using the command xfa.host.exportData("", false), but you will not be able to do it unattended. For security reasons the user has to be involved in the save. This command will brinng up a dialog and allow the user to choose the location and filename for the save. The only way you can do it unattended is to Certify the PDF with a certificate and have the certificate that was used to certify resident in the trusted store of the users machine. This indicates that the users trust the source of the PDF and will allow interaction with resources in their machine.