Transforming multiple loops

Team,

I have input xml with multiple orders, each order having multiple order lines. I need to map this to output having different element names.

I have two loops (orders and items inside orders) I am using appendToDocList for each loop. But my final output has only last order and my all my previous orders are wiped out.

Please see the attachment for complete package.

Thank you in advance for all of your help.
MultipleDocuments.zip (11.3 KB)

You are using the appendtoDocumentList in a wrong way …
When you call this service… map the target o/p list to “toList” pararms, and map the output toList to again to same target o/p list…

Don’t forget the drop toList after this step from pipeline…
Please refer to the documentation for more on this service…

I am not getting what you are saying. Would you mind modifying the code and send it to me?

here you go… to be honest… the document structure you are using is little weired but … test with proper inputs…
MultipleDocuments.zip (12 KB)