You can simply return children.GetEnumerator()
in this case. (By the way your GroupNode object should implement IEnumerable and your GetEnumerator method should have the correct return type.)
public IEnumerator<ISceneNode> GetEnumerator()
{
return children.GetEnumerator()
}
In more general cases though you can iterate over something and call yield return
for each element.