dom动态生成xml文件方法:
class="java">
public String flashPieCharts() throws IOException ,FileNotFoundException {
		
	//生成xml
	//创建根节点 pie
	Element root = new Element("pie");
	//根节点添加到文档中;   
	Document Doc = new Document(root);
	
	for(int i = 0;i < 5;i ++) {
		// 创建节点 slice
		Element elements = new Element("slice");
		// 给 slice 节点添加属性 title,值为群组名
		elements.setAttribute("title", "test");
		//elements.setAttribute("url", "xxx");
		// 设定节点值为数量
		elements.setText("100");
		root.addContent(elements);
	}
	Format format = Format.getPrettyFormat();
	XMLOutputter XMLOut = new XMLOutputter(format);
	// 输出 user.xml 文件
	XMLOut.output(Doc, new FileOutputStream("d:\\pie.xml",false));
	
	return "";
}