Return a string with Print tree, rather than printing it