Hello

I need to merge two xml files,

we have "XML1 corrosponds to XSD1", and "XML2 corrosponds to XSD2".
ths XSD2 is quite similar to XSD1, but have few extra tags, that has been generated in XML2.
Now on merging xml1 and xml2, we require every data of xml1, with newly added tags in xml2.

following examples may throw light over requirement, to bring clarity.


XML1

<A>
<B>
<C>abc</C>
</B>
</A>

XML2

<A>
<B>
<C>xyz</C>.............(Tag already present...no change)
<D></D>................(Mandatory Tag)
<E></E>................(Optional Tag...not to be merge)
</B>
<K>
</K>.................(Mandatory)
</A>



Require Result.xml:

<A>
<B>
<C>abc</C>,...........(has value "abc" as in XML1)
<D></D>..............(Mandatory Tag)
</B>
<K>
</K>.................(Mandatory)
</A>




i search google but unable to find any relative solutions..
especially:
getting decide, which node is optional, and which have more than one occourence?

waiting 4 ur early response !!
Thanks in Advanced!!