Function getFlatChildren