Mapping between 2 documents dynamically

i have one document in pipeline in and one document in pipeline out. I have to do mapping between these 2 documents by reading the data from DB.

i am giving the doc format below. Doc1 is in pipeline in and Doc2 is in pipeline out.

Doc1 Doc2

Data TransData
–ReqNo --RequestNumber
–ReqLine --RequestLine
–WONumber --WorkOrderNumber
–TasKNo --TaskNumber
–UserName --UserName

i will read the doc elements from DB and have to map between these 2 documents at runtime.

For example, i have to map from Data/ReqNo on Doc1 to TransData/RequestNumber on Doc2.

Like this i have to complete all the mapping at runtime.
Hope you understood my question!!!