Recursive template works for control tree

Now it just needs some serious restyling.