The TreeWalker object represents the nodes of a document subtree and a position within them.
TreeWalker
A TreeWalker can be created using the createTreeWalker() method of the document object.
createTreeWalker()
document