I have two XML files. The first is:
<a>
<b>
<c1>1</c1>
</b>
<b>
<c1>2</c1>
</b>
<b "id" = "true">
<c1>3</c1>
<d "do" ="me"></d>
</b>
<b id ="true">
<c1>4</c1>
</b>
</a>
And the second is:
<a>
<b>
<c1>5</c1>
</b>
</a>
I want to update an element from first.xml:
<b "id" = "true">
<c1>3</c1>
<d "do" ="me"></d>
</b>
with an element from second.xml:
<b>
<c1>5</c1>
</b>
I tried to achieve that by deleting all the <b>
nodes from first.xml and add the node <b>
taken from second.xml file. I am able to delete all the nodes <b>
but not able get an element from second.xml and add that to the first.xml.