添加依赖 <dependency> <groupId>dom4j</groupId> <artifactId>dom4j</artifactId> <version>1.6.1</version> </dependency> 关键代码 Document doc = DocumentHelper.createDocument(); Element root = doc.addElement("root"); Element model = root.