Change how hierarchical list datasets is done

This fixes a bug where a child dataset is appended to the wrong parent.

Ticket:	#5639