Allow method to return whole tree (needed by new PhyloXMLWriter code in compara API)
Refactored to accommodate changes to compara API