I have only found this documentation on installing xpath explorer on netbeans, therefore I’ll give a little more info for mac osx (it’s easy but you have to search a little).
1. download the xpe-netbeans.jar file (from the xpe project download page).
2. place the xpe-netbeans.jar file in your NetBeans module lib dir, the following worked for me:
/Applications/NetBeans/NetBeans 6.5.app/Contents/Resources/NetBeans/platform9/lib
3. restart NetBeans and you should see the following menu option: Tools > XPath Explorer.
Adapt these instructions for your NetBeans installation path and version number if different.