For example, say I have two XML Strings that I want to merge:
<Test> <A>false</A> <B>true</B> <C>Transfers!</C> </Test> <Test2> <A>false</A> <B>false</B> </Test2>
Where the final result looks like (notice, B is now false, because I would like a place to do some sort of logic to determine the final "merged values", in this example, a method would take in two strings, false, and true, and do some AND logic and return "false")
<Test> <A>false</A> <B>false</B> <C>Transfers!</C> </Test>
I am thinking of either doing it all by hand, using JAX-B & XPath, or XStream Marshal/Unmarshallers. Does anyone have an example of the best & most dynamic way to do this?
The element names will change, they will not always be "A" and "B", but the two XML strings I pass in will always have some elements in common, but sometimes one XML String/Document may have one or more elements that don't exist in the other document, and in this case those need to be in the final XML result as is.