public static void printNode(TreeNode root, string tabs) { Console.WriteLine(tabs + '|' + root.attribute + '|'); if (root.attribute.values != null) { for (int i = 0; i < root.attribute.values.Length; i++) { Console.WriteLine(tabs + "\t" + "<" + root.attribute.values[i] + ">"); TreeNode childNode = root.getChildByBranchName(root.attribute.values[i]); printNode(childNode, "\t" + tabs); } } }