Add boxes to expand/contract tree branches.
function that collects all the selected nodes.