example merging: test78 if element is different , take element from file2

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

Input:
Files "test78a.xml" and "test78b.xml" should be merged according the merge-rules of file "merge78.xml".
Person "Fischer Ludwig" exists only in file "test78a.xml".
Person "Fischer Heinz" exists only in file "test78b.xml".
Person "Fischer Albert" has a different value in element "<residence>" in file "test78b.xml".

Merge-rules:
The merge-result should contain the persons of both files.
If the value of field element <residence> differs, the value of file "test78b.xml" should be taken.

Merge-result:
Person "Fischer Werner" is unchanged compared to file "test78a.xml".
Person "Fischer Heinz" is new compared to file "test78a.xml.
Person "Fischer Albert" has now the value "Paris" in element "<residence>".

merge-control-file: merge78.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='33' >
    <value path='/residence'                       merge='332' />
</identity>
</merge>
file: test78a.xml
<?xml version='1.0' encoding='UTF-8'?>
<delivery>
	<list_person>
		<person>
			<name>Fischer</name>
			<firstname>Werner</firstname>
			<residence>Munich</residence>
		</person>
		<person>
			<name>Fischer</name>
			<firstname>Ludwig</firstname>
			<residence>Frankfurt</residence>
		</person>
		<person>
			<name>Fischer</name>
			<firstname>Albert</firstname>
			<residence>New York</residence>
		</person>
	</list_person>
</delivery>

file: test78b.xml
<?xml version='1.0' encoding='UTF-8'?>
<delivery>
	<list_person>
		<person>
			<name>Fischer</name>
			<firstname>Werner</firstname>
			<residence>Munich</residence>
		</person>
		<person>
			<name>Fischer</name>
			<firstname>Heinz</firstname>
			<residence>Frankfurt</residence>
		</person>
		<person>
			<name>Fischer</name>
			<firstname>Albert</firstname>
			<residence>Paris</residence>
		</person>
	</list_person>
</delivery>

merge-result on stdout
<?xml version='1.0' encoding='UTF-8'?>
<delivery>
	<list_person>
		<person>
			<name>Fischer</name><firstname>Albert</firstname>
			<residence>Paris</residence>
		</person>
		
		<person>
			<name>Fischer</name><firstname>Heinz</firstname>
			<residence>Frankfurt</residence>
		</person>
		
		<person>
			<name>Fischer</name><firstname>Ludwig</firstname>
			<residence>Frankfurt</residence>
		</person>
		<person>
			<name>Fischer</name><firstname>Werner</firstname>
			<residence>Munich</residence>
		</person>
	</list_person>
</delivery>