dom4j string转为xml

/**XML转字符串 */
Document document = new SAXReader().read(new File("E:test.xml"));; 
String text = document.asXML(); 
/**字符串转XML */
String xmlStr = ****; 
Document document = DocumentHelper.parseText(xmlStr);
原文地址:https://www.cnblogs.com/tiancai/p/10071404.html