Merge XML nodes that correspond to the same territory.