Include IDOC_DATA_REC_40 in IDOC to external System with E2 Segments

I would like to include the IDOC_DATA_REC_40 info for each tag on the IDOC I am sending to an External System which accepts E2 segments. I have the document Type with the E2 segments and I want to convert the Local IDOC to that. I am simply ,apping the fields which correspond but I don’t know how to include the IDOC_DATA_REC_40 i.e SEGNUM, PSGNUM etc on the out going IDOC.

Capture.PNG

I have decided to use an XSLT service.