I have some trouble for adding an element to an xml file
I have an xml with this structure:
<Root>
<Item>
<ItemId>first</ItemId>
<Datas>
<Data>one</Data>
<Data>two</Data>
<Data>three</Data>
</Datas>
</Item>
<Item>
<ItemId>second</ItemId>
<Datas>
<Data>one</Data>
<Data>two</Data>
<Data>three</Data>
</Datas>
</Item>
</Root>
and i want to add data only when the itemid is second, and get an output like this:
<Root>
<Item>
<ItemId>first</ItemId>
<Datas>
<Data>one</Data>
<Data>two</Data>
<Data>three</Data>
</Datas>
</Item>
<Item>
<ItemId>second</ItemId>
<Datas>
<Data>one</Data>
<Data>two</Data>
<Data>three</Data>
<Data>FOUR</Data>
<Data>FIVE</Data>
</Datas>
</Item>
</Root>
Thanks for your help!