XML, the Perl Way

Tree::XPathEngine

Tree::XPathEngine is a fork of XML::XPath that can be used to add XPath query to unsuspecting trees. The fork removed the dependency to XML::Parser, and all XML-specific features (namespaces, processing instructions...)

Basically it requires a tree that behaves like a simplified DOM tree, meaning that its nodes implement the methods needed by Tree::XPathEngine. It then lets you perform full XPath queries on the tree.

Tree::XPathEngine is used by Tree::DAG_Node::XPath, which adds XPath queries to generic DAG Nodes. Tree::DAG_Node::XPath is also a good example of how to add XPath to a pre-existing module.