"Filters are objects that know how to "filter out" nodes. If a
NodeIterator or a TreeWalker is given a NodeFilter, it applies the
filter before it returns the next node. If the filter says to accept
the node, the traversal logic returns it; otherwise, traversal looks
for the next node and pretends that the node was rejected was not
This definition is given by the DOM Traversal and Range
Specification. It explains pretty well, what this class is for: A
XML::NodeFilter will recieve a node from a traversal object, such as
XML::LibXML::Iterator is one and tells if the given node should be
returned to the caller or not.
Although I refere only to XML::LibXML here, XML::NodeFilter is
implemented more open, so it can be used with other DOM
implementations as well.