add treeToString method to General