Minimize code duplication between node and its children
Put them into the same Array and operate on that.
Differential Revision: https://phabricator.kde.org/D20593