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);
posted @ 2018-12-05 15:51  甜菜波波  阅读(745)  评论(0编辑  收藏  举报