I have the following input xml and want to insert a new <ADDON> container with new elements inside. The input xml may have one or many <ADDON> containers already, in which case I want to add another <ADDON> container some static data. Can you assist?
Input XML:
Code:
<ROOT>
<MANYOTHERELEMENTS>
<PARENTOFADDON>
<ADDON>
<Aelement>ExisingData</Aelement>
</ADDON>
</PARENTOFADDON>
</MANYOTHERELEMENTS>
</ROOT>
Desired output xml:
Code:
<ROOT>
<MANYOTHERELEMENTS>
<PARENTOFADDON>
<ADDON>
<Aelement>ExisingData</Aelement>
</ADDON>
<ADDON>
<Aelement>MyData</Aelement>
</ADDON>
</PARENTOFADDON>
</MANYOTHERELEMENTS>
</ROOT>