I have a class that references itself, like this:

```
public class Person
{
    int Id { get; set; }
    string Name { get; set; }
    DateTime CreatedOn { get; set; }

    Person Parent { get; set; }
    ICollection<Person> Children { get; set; }
}

```

What I need is a Linq query that will return a list comprised of only the most recent record (based on "CreatedOn") for those records that have children, or the Parent itself, for those that don't. The query also needs to apply some filters to the entire "family". For instance, if I'm filtering by the name "John" and only the parent's name is "John", I still need to retrieve its most recent child.

Any help would be appreciated.