Added support for merging collections into a tree