xml转换String输出

System.out.println("workflowSend ############# start ");
try {
Format format = Format.getPrettyFormat();
//format.setEncoding("gb2312");//����xml�ĵ����ַ�Ϊgb2312�������������
XMLOutputter xmlout = new XMLOutputter(format);
ByteArrayOutputStream bo = new ByteArrayOutputStream();
xmlout.output(doc, bo);
String xmlStr = bo.toString();
System.out.println("xmlStr:\r\n"+xmlStr);
} catch (Exception e) {
}

System.out.println("workflowSend ############# end");

原文地址:https://www.cnblogs.com/anuoruibo/p/2980952.html