XML parsing errors for using the API nlapiXMLtoPDF usually means that the XML is not well formed according to the XML specification on BFO.
Firstly, check your XML if it is malformed by validating on some online free tools by pasting your XML code or uploading the file. Here are some online tools you can use:
- Validome - http://www.validome.org/xml/
- W3Schools validator - http://www.w3schools.com/xml/xml_validator.asp
- and http://www.xmlvalidation.com/
Next, if you still have the same error. Kindly refer to these guides. These BFO documentation would specify the valid tags you can use for the XML.