Каков наиболее эффективный способ перебора всех элементов DOM в Java?
Что-то вроде этого, но для каждого отдельного элемента DOM на текущем org.w3c.dom.Document
?
for(Node childNode = node.getFirstChild(); childNode!=null;){
Node nextChild = childNode.getNextSibling();
// Do something with childNode, including move or delete...
childNode = nextChild;
}