SAXReader saxReader = new SAXReader(); Document document = saxReader.read(new ByteArrayInputStream(xml.getBytes())); 或者这样也可以 document = DocumentHelper.parseText(xml);