XML-file is the best way to transfer data and it has many advantages. Various functions are available in SAP for exporting IDoc data. Here is one example …
To export an IDoc as an XML, you will first need to open transaction SE37.

FM: IDOC_XML_TRANSFORM
Need enter only the Idoc number and execute…

Result:

Ctrl+A, Ctrl+C and Ctrl+V will allow you to view the XML content with any editor.