for(Iterator j = element.elementIterator();j.hasNext();){
                Attribute attribute = (Attribute) j.next();
                System.out.println(attribute.getName() +","+attribute.getValue());
            }Element和Attribute 不是一个概念,为何要强转呢?如果想拿到Attribute ,有API: element.attributes()。