This question is more an xsltproc question than a taxon2newick question, but I'm hoping you might have a ready answer. The XML document returned by efetch is actually multiple concatenated XML documents, each with 100 entries. This causes xsltproc to complain. I could hack it up with a sed script, but I'm hoping that you have a more elegant solution.
❯❯❯ esearch -db taxonomy -query 'Primates[Subtree] ' |efetch -format xml >mammalia.xml
❯❯❯ xsltproc taxon2newick.xsl mammalia.xml
mammalia.xml:17264: parser error : XML declaration allowed only at the start of the document
<?xml version="1.0"?>
^
mammalia.xml:17265: parser error : Extra content at the end of the document
<!DOCTYPE TaxaSet PUBLIC "-//NLM//DTD Taxon, 14th January 2002//EN" "http://www.
^
unable to parse mammalia.xml