conversion from tree to std::string