public static IEnumerable<IExplorerItem> Descendants(this IExplorerItem root)
{
var nodes = new Stack<IExplorerItem>(new[] { root });
while(nodes.Any())
{
IExplorerItem node = nodes.Pop();
yield return node;
if(node.Children != null)
{
foreach(var n in node.Children) nodes.Push(n);
}
}
}
}