protected void ite(Element e) {
List elements = e.elements();
Iterator it = elements.iterator();
String thString = null;
Element element = document.getRootElement();
List<Element> list = element.elements();//就这行报错 
Element elementTwo = list.get(0);
if ("data".equals(e.attributeValue("type"))) {
if (!e.equals(element)) {
++tkey;
tString = thString + "0" + String.valueOf(tkey);
}
insertRow(e, it);
} else {
tkey = tkey - 2;
insertRow(e, it);
while (it.hasNext()) {
Element elem = (Element) it.next();
++thkey;
if (e.equals(element) && !elem.equals(elementTwo)) {
int forkey = Integer.valueOf(thString);
thString = "0" + String.valueOf(forkey + 1);
}
//递归遍历 
ite(elem);
}
}
if (thkey >= 1) {
--thkey;
}
}报错org.dom4j.tree.DefaultText cannot be cast to org.dom4j.Element
谁知道怎么回事  其他写的挺乱 不用看