Please make XML::XPath::Literal, XML::XPath::Boolean, XML::XPath::Number descend from a common (probably empty) base class for easier ISA checks, and then let that base class and XML::XPath::NodeSet descend from another common (and possibly empy) base class for the same reason.