code: public static String getNewickString(Phylogeny phylo,
  			boolean writeDistances) throws IOException {
  
  		PhylogenyWriter w = new PhylogenyWriter();
  		StringBuffer newickString = w.toNewHampshire(phylo, writeDistances);
  		return newickString.toString();
  	}
docs: Convert a Phylogenetic tree to its Newick representation, so that it can
  be exported to an external application.
  
  @param phylo
  Phylogeny phylogenetic tree
  @param writeDistances
  write the branch lengths if true
  @return
  @throws IOException