This loops through the matches and looks for the deepest child node of all of
the matches. "Deepest", here, is relative to the nodes in the list. It is
calculated as the distance from the starting node to the most distant child
node. In other words, it is not necessarily the farthest node from the root
element, but the farthest note from the matched element.
In the case where there are multiple nodes at the same depth, all of the
nodes at that depth will be included.