parser for tree in various formats.