As @pilchard correctly commented in What are the differences between a TreeWalker and a NodeIterator?
The differences are clearly discussed in the spec: W3C: Document Object Model Traversal — "The TreeWalker interface provides many of the same benefits as the Iterator interface. The main difference between these two interfaces is that the TreeWalker presents a tree-oriented view of the nodes in a subtree, and an Iterator presents a list-oriented view. In other words, an Iterator allows you to move forward or back, but a TreeWalker allows you to move to the parent of a node, to one of its children, or to a sibling."