Implements an Iterable to iterate the mainline.
Iterable<T> mainline() sync* { var node = this; while (node.children.isNotEmpty) { final child = node.children[0]; yield child.data; node = child; } }