Right I worked it out.
So thats what Base64Decode is for!
For anyone else with this problem:
The pdf is encoded as a text string using some function that does 'Base64Encode'. This text string is just included in the XML (in my case in an 'Attachment') element.
To get it back to being a PDF you use the Base64Decode function in FileMaker. I specified a filename and extension 'file.pdf', in the function.
I just used the function as the 'specify calculation' in a set field step
You answered yourself quicker than I could...