I am using the following code to create dxl string.
DxlExporter exporter = session.createDxlExporter();
exporter.setConvertNotesBitmapsToGIF(true);
String dxl = exporter.exportDxl(document);
It is taking around 2 seconds to return dxl string for an email having multiple inline images with total size around 20 Mb