import itertools


def xnat_children(obj):
    """
    Returns the XNAT objects contained in the given parent object.
    
    :param obj: the XNAT parent object
    :return: the child objects
    :rtype: list
    """
    # pyxnat children() is oddly the child collection attributes
    # rather than objects.
    child_attrs = obj.children()
    # The children generators for each child type.
    nested = (getattr(obj, attr)() for attr in child_attrs)
    flattened = itertools.chain(*nested)
    
    return list(flattened)