List list = (document.selectNodes("/books/book/@show" )); // xpath解析
Iterator iter = list.iterator();
while(iter.hasNext()){
Attribute attribute = (Attribute)iter.next();
if(attribute.getValue().equals("yes")){
attribute.setValue("no");
}
Element ownerElement = (Element)iter.next();
Element dateElement = ownerElement.addElement("date");
dateElement.setText("2004-09-11");
}