I'm trying to make a mapping with this xml:
<rootxml>
<documents>
<document>
<iddoc>1</iddoc>
<total_price>1000</total_price>
</document>
</documents>
<items>
<item>
<iddoc>1</iddoc>
<iditem>1</iditem>
<quantity>1</quantity>
<price>800</price>
</item>
<item>
<iddoc>1</iddoc>
<iditem>2</iditem>
<quantity>1</quantity>
<price>200</price>
</item>
</items>
<taxes>
<tax>
<iddoc>1</iddoc>
<iditem>1</iditem>
<idtax>1000</idtax>
<value>123.90</value>
<tax>
<tax>
<iddoc>1</iddoc>
<iditem>2</iditem>
<idtax>1000</idtax>
<value>34.13</value>
<tax>
</taxes>
</rootxml>
to this one:
<resultxml>
<documento>
<iddoc>1</iddoc>
<total_price>1000</total_price>
<items>
<item>
<iddoc>1</iddoc>
<iditem>1</iditem>
<quantity>1</quantity>
<price>800</price>
<taxes>
<idtax>1000</idtax>
<value>123.90</value>
</taxes>
</item>
<item>
<iddoc>1</iddoc>
<iditem>2</iditem>
<quantity>1</quantity>
<price>200</price>
<taxes>
<tax>
<idtax>1000</idtax>
<value>34.13</value>
<tax>
</taxes>
</item>
</items>
</documento>
</resultxml>
I can't find out how to solve this. Although the original xml document can have several documents it will always have one, so I have to merge the items into it and taxes into its respective item.
Thank you