Have a look at the getNthFieldName method and the numFields property of the Document object.
Using these two allows you to get the full list of names of the fields in the file dynamically, so you don't need to hard-code the names into your script.
In the first step I see, with getNthFieldName and numFields, all fields of the PDF now, but I have no idea how to access to the fields of the XML.
Thank you in advance.
If the values are all under the same node then you can do it like this (let's say the variable fieldName contains the name of the field you want to access):
Ups, too many trees in a forest ;-)