def has_children(elem):
    """Check if elem has any child elements."""
    if type(elem) == list:
        return True
    try:
        for child in elem:
            if type(child) == list:
                return True
    except TypeError:
        return False
    return False