example merging: test84 merging from file2 only, if identities are equal

basic-control-file: cmp84.xml
<?xml version="1.0" encoding="UTF-8"?>
<delivery>
	<list_person>
		<person>
			<name       ident_text="true"   />
			<firstname  ident_text="true"   />
			<size       cmp_text="true"   />
			<weight     cmp_text="true"   />
		</person>
	</list_person>
</delivery>
explanation

Input:
Files "test84a.xml" and "test84b.xml" should be merged according the merge-rules of file "merge84.xml".
Person "Fischer Werner" and "Becker Petra" exist in both files.
Person "Bauer Josef" exists only in file "test84a.xml".
Person "Bauer Herbert" exists only in file "test84b.xml".
The <weigth>- and <size>-element of person "Fischer Werner" is in both files different.
The <weigth>-element of person "Becker Petra" is in both files different.
Person "Becker Petra" has in file "test84b.xml" a <weight>-element, which does not exists in file "test84a.xml".
Merge-rules:
The merge-rules mean: Take all persons from file "test84a.xml". If the content of the elements <weight> and <size> of these persons differ to the content of file "test84b.xml", take the content from file "test84b.xml".
Merge-result:
In the merge-result there are all person from file "test84a.xml". Their elements <weight> and <size> have the content of file "test84b.xml".

merge-control-file: merge84.xml
<?xml version='1.0' encoding='UTF-8'?>
<!--
Element <identity>: Explanation of the merge-Attributes:

     merge='??'
            ||
            |If rows are equal:
            |________________________________________________________
            |0 = take no row from input1 or input2
            |3 = merge rows from input1 and input2.
            |________________________________________________________
            |
            If rows are not equal:
            _________________________________________________________
            0 = take no row from input1 or input2
            1 = take only row from input1
            2 = take only row from input2
            3 = take row from input1 and input2.

Element <value>: Explanation of the merge-Attributes:

     merge='???'
            |||
            ||If element/attribute-name are equal but contents are not equal:
            ||_______________________________________________________
            ||0 = take no attribute/element from input1 or input2
            ||1 = take attribute/element from input1
            ||2 = take attribute/element from input2
            ||3 = take attribute/element from input1 and input2 (not possible if path is an attribute)
            ||
            |If element/attribute-name and content are equal:
            |________________________________________________________
            |0 = take no element/attribute from input1 or input2
            |3 = take element/attribute from input1 or input2
            |________________________________________________________
            |
            If element/attribute-name are not equal:
            _________________________________________________________
            0 = take no element/attribute from input1 or input2
            1 = take only element/attribute from input1
            2 = take only element/attribute from input2
            3 = take element/attribute from input1 and input2.
-->
<merge>
<identity path='/delivery/list_person/person'      merge='13' >
    <value path='/size'                            merge='132' />
    <value path='/weight'                          merge='132' />
</identity>
</merge>
file: test84a.xml
<?xml version='1.0' encoding='UTF-8'?>
<delivery>
	<list_person>
		<person>
			<name>Fischer</name>
			<firstname>Werner</firstname>
			<weight>80</weight>
			<size>180</size>
		</person>
		<person>
			<name>Bauer</name>
			<firstname>Josef</firstname>
			<size>186</size>
		</person>
		<person>
			<name>Becker</name>
			<firstname>Petra</firstname>
			<weight>70</weight>
		</person>


	</list_person>
</delivery>
file: test84b.xml
<?xml version='1.0' encoding='UTF-8'?>
<delivery>
	<list_person>
		<person>
			<name>Fischer</name>
			<firstname>Werner</firstname>
			<weight>81</weight>
			<size>181</size>
		</person>
		<person>
			<name>Bauer</name>
			<firstname>Herbert</firstname>
			<weight>130</weight>
			<size>186</size>
		</person>
		<person>
			<name>Becker</name>
			<firstname>Petra</firstname>
			<weight>71</weight>
			<size>154</size>
		</person>


	</list_person>
</delivery>
merge-result on stdout
<?xml version='1.0' encoding='UTF-8'?>
<delivery>
	<list_person>
		<person>
			<name>Bauer</name><firstname>Josef</firstname>
			<size>186</size>
		</person>
		<person>
			<name>Becker</name><firstname>Petra</firstname>
			<weight>71</weight>
		</person>
		<person>
			<name>Fischer</name><firstname>Werner</firstname>
			<weight>81</weight><size>181</size>
		</person>
	</list_person>
</delivery>