利用fastjson转换,pom文件依赖:
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.68</version>
</dependency>
工具类
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.dom4j.*;
import java.util.List;
public class test {
/**
* String 转 org.dom4j.Document
*
* @param xml
* @return
* @throws DocumentException
*/
public static Document strToDocument(String xml) {
try {