Nidheesh Krishna wrote:how can i find what are the extra nodes to add?
I would have thought you already knew how to do that for your particular variety of XML documents. If you want something which compares two arbitrary XML documents and identifies nodes which are in one but not the other, then that's a very difficult problem. And then you're going to ask how to insert those "extra" nodes into the "right place" in the other document, which is also a very difficult problem.
So do you have an actual use case for this question? Do you have a set of documents for which you want to do this insertion-of-missing-nodes thing?