// 获取Document对象
Document document = DocumentHelper.createDocument();
// 创建根节点元素Element root = DocumentHelper.createElement("bj");
document.setRootElement(root);
//根节点下添加子元素 addElement() addAttribute()添加元素的属性节点 addText()添加文本节点 getParent()得到父节点
root.addElement("xsxx").addAttribute("id", "xs1").addElement("xh")
.addAttribute("bh", "bh001").addText("001").getParent()
.addElement("xm").addText("张三").getParent().addElement("xb")
.addText("男");
//得到输出通道 并设置输出的样式
OutputFormat outputFormat = OutputFormat.createCompactFormat();
outputFormat.setEncoding("gbk");
outputFormat.setIndent(true);
outputFormat.crea