XML ValidatorBuddy has a built-in XPath window which supports quick and easy evaluation of XPath 1.0 and XPath 2.0 expressions:
Turn on the "Evaluate on typing" option to get the XPath results immediately on typing. As long as the expression is incomplete and can't be evaluated an error message will show additional error information.
Setting the evaluation context
You can use the "Evaluate" button on the XPath window to select in which context the XPath expression should be evaluated. The default context is Document. To change the context just select the XML node directly in the active document. The evaluation context is also shown in the XPath results area.
Generating an XPath
There are two commands available in the Edit menu and from the main toolbar to generate XPath statements for the currently selected XML node or attribute in the active document.
Use the "Copy XPath (simplified)" command to get an XPath statement without any namespace information. This will produce a more human-readable XPath.
Use the "Copy XPath" command to get a full-qualified XPath statement also containing namespace information if required. This will generate an XPath which can be directly used in XSLT or Schematron files.