Fix XML loading and saving
Add methods for tree matching
Add 'no connected leaves' replacement strategy