I have problem merging two XML files. I loaded both files into two objects, located the target nodes in both objects and tried to merge.
Here is a sample:
var nodes1 = XResult1.Descendants("subject");
var nodes2 = XResult2.Descendants("subject");
//nodes1.Add(nodes2.Nodes());
//* Code to merge** Can somebody pls help me. Thanks in advance... BB
Here is my XResult1:
<subjects> <subject> <node id="1"> Hi </node> <node id="2"> Hi again </node> <node id="3"> Hi once more </node> </subject> </subjects>
Here is my XResult2 :
<subjects> <subject> <node id="4"> Hello </node> <node id="5"> Hello again </node> </subject> </subjects>
And my final Result should be :
<subjects> <subject> <node id="1"> Hi </node> <node id="2"> Hi again </node> <node id="3"> Hi once more </node> <node id="4"> Hello </node> <node id="5"> Hello again </node> </subject> </subjects>