def get_layer_children(root, result):
    """
    return given layer and their children
    :param root: root layer
    :param result: result layer list
    :return: layer list
    """
    # print root.name
    num_children = root.getNumChildren()
    if num_children == 0:
        result.append(root)
    else:
        for i in range(1, num_children + 1):
            child = root.getChild(i)
            # print "step" + str(i) + " " + child.name
            get_layer_children(child, result)
    return result