字符串 s 包含解析树的 XML 输出"
import java.io.StringWriter;
import java.io.PrintWriter;
StringWriter stringWriter = new StringWriter();
PrintWriter writer = new PrintWriter(stringWriter);
tree.indentedXMLPrint( writer, false);
String s = stringWriter.toString()