如何将 document 对象转换为 String
使用下面的代码可以将 document 输出到 String 中。
String responseXML = new XMLOutputter().outputString(document);
然后将 String 写到文件中,我们可以看到下面的输出内容。