toTreeString implemented by Visitor pattern