一、使用最原始的javax.xml.parsers,标准的jdk api
// 字符串转XML
- StringxmlStr=\"......\";
- StringReadersr=newStringReader(xmlStr);
- InputSourceis=newInputSource(sr);
- DocumentBuilderFactoryfactory=DocumentBuilderFactory.newInstance();
- DocumentBuilderbuilder=factory.newDocumentBuilder();
- Documentdoc=builder.parse(is);
//XML转字符串
?