谁能帮我看一看我这哪错了? //获得一个xml解析器
DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
DocumentBuilder builder=factory.newDocumentBuilder();

Document doc=builder.newDocument();
//创建
Element root=doc.createElement("catalog");
//将根元素填加上文档
doc.appendChild(root);
//建立book元素
Element book4=doc.createElement("CCC");
book4.setAttribute("id","book"+1);
root.appendChild(book4);
for(int i=0;i<1;i++){
Element book=doc.createElement("book");
book.setAttribute("id","book"+i+1);
root.appendChild(book);
//建立author,title元素
Element author=doc.createElement("author");
book.appendChild(author);
Text tAuthor=doc.createTextNode("飞碟");
author.appendChild(tAuthor);
Element title=doc.createElement("title");
book.appendChild(title);
Text tTitle=doc.createTextNode("飞碟众书");
title.appendChild(tTitle);
//创建publish_date 
Element publish_date=doc.createElement("publish_date");
book.appendChild(publish_date);
Element year=doc.createElement("year");
publish_date.appendChild(year);
Text tYear=doc.createTextNode("2003");
year.appendChild(tYear);
Element month=doc.createElement("month");
publish_date.appendChild(month);
Text tMonth=doc.createTextNode("05");
month.appendChild(tMonth);
Element day=doc.createElement("day");
publish_date.appendChild(day);
Text tDay=doc.createTextNode("29");
day.appendChild(tDay);
//创建描述
Element description=doc.createElement("description");
book.appendChild(description);
Text tDescription=doc.createTextNode("一本好书书书书");
description.appendChild(tDescription);
}
//写入XML文件
FileWriter fw=new FileWriter("aaa.xml");
StreamResult result = new StreamResult(fw); 
StreamSource xsl=new StreamSource("F:/website/newshns/bbs/1000/style.xsl");
DOMSource source=new DOMSource(doc);
Transformer trans = TransformerFactory.newInstance().newTransformer(xsl);
trans.setOutputProperty("encoding","GB2312");
trans.transform(source,result);
fw.close();