The TreeWalker object represents the nodes of a document subtree and a position within them.
TreeWalker
MDN Reference