Element element = rootElement.addElement("childElement");
element.addAttribute("attributeName", "attributeValue");
element.addText("This is the text content of the element");
element.addCDATA("This is the CDATA content of the element");
Element childElement = rootElement.addElement("childElement").addAttribute("attributeName", "attributeValue");
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
推荐阅读:dom4j怎么判断是否有子节点