Is tthere a way to use LINQ on a Transform?

I know that you can loop through all the children on a transform in a foreach loop like this

   foreach (Transform child in transform)
    {
    
    }

Is there a way to do this with LINQ? I would have thought it was something along the lines of transform.Where(x => ...);

but that gives me an error.

Apparently the transform component does not implement the generic version of IEnumerable. So to do it you need to cast the output of the LINQ call like this

List<GameObject> children = transform
                           .Cast<Transform>()
                           .Select(t => t.gameObject)
                           .ToList();