Parsing folder for pairs with bash or AppleScript
In Terminal, change directory, e.g. cd /path/to/files, to the location of the target files and then use the following command to delete any .xmp file that doesn't have a corresponding .NEF file:

for f in *.xmp; do [[ ! -f ${f%.*}.NEF ]] &amp;&amp; rm "$f"; done