Order nodes by priority (sub-nodes count)