join multiple nodes of same kind

If multiple nodes of the same kind (e.g. elements with the same name)
are selected, the join method will join them to one node.

If elements are joined, the attributes of the first element are used for
the result.

Change-Id: I91199271af819d60d4930801aed38ff74fc30d43
8 files changed