Hi I am mapping from IDoc to an XML format. The IDoc is a PO Documnet and has the following structure.

I need help in mapping OrderLineItems
Suppose, for line-num 1 the ordered-qty is 50 and we have to ship them in two ( first schedule date 30, next schedule 20 ) installments i.e., we have two schedules, schedule id 1, req-qty 30, schedule-dates schedule-date is 2013Jan01, and the remaining 20 items we have to ship them in next schedule i.e., schedule id 2, req-qty 20, schedule-date schedule-date is 2013Feb01.
And for line-num 2 say we have only one schedule and the ordered-qty is 30, schedule 1, req-qty 30 , schedule-dates schedule-date is 2013Jan01.
Sample data in Idoc is
PO
Sender
Receiver
Line-item
Line-item[0]
line-num 1
ordered-qty 50
Schedule
Schedule[0]
id 1
req-qty 30
Schedule-dates
Schedule-dates[0]
Schedule-date 2013Jan01
Schedule[1]
id 2
req-qty 20
Schedule-dates
Schedule-dates[0]
Schedule-date 2013Feb01
Line-item[1]
line-num 2
ordered-qty 30
Schedule
Schedule[0]
id 1
req-qty 30
Schedule-dates
Schedule-dates[0]
Schedule-date 2013Jan01
My requirement is:
For each shedule ship date a new OrderLineItem needs to be created. The line information will repeat each time. One OrderLineItem group should be sent per unique Line Number and Line Item Schedule.
The output should be.
1
30
2013Jan01
1
20
2013Feb01
2
30
2013Jan01
Any help is appriciated.
#Integration-Server-and-ESB#Flow-and-Java-services#webMethods