Utility to deserialize tree