hm..we have for a long time -it works without any problems and depth restrictions
But why do I need this yours function?Code:public Element GetElementByString(string str) { return Text == str ? this : Children.Select(child => child.GetElementByString(str)).FirstOrDefault(element => element != null); }