func (tn *TreeNode) Iterate(operation func(node *TreeNode)) {
	operation(tn)
	for i, child := range tn.Children {
		child.Iterate(operation)
		tn.Children[i] = child
	}
}
Iterate loops all nodes in the tree
package query
import (
	"context"
	"encoding/json"
	"errors"
	"fmt"
	"strings"
	"github.com/digimakergo/digimaker/core/contenttype"
	"github.com/digimakergo/digimaker/core/db"
	"github.com/digimakergo/digimaker/core/definition"
	"github.com/digimakergo/digimaker/core/fieldtype"
	"github.com/digimakergo/digimaker/core/permission"
	"github.com/digimakergo/digimaker/core/util"
)
type TreeNode struct {
	*contenttype.Location
	Fields   interface{}              `json:"fields"`  
	Content  contenttype.ContentTyper `json:"content"`
	Children []TreeNode               `json:"children"`
}