NPCs often have some observable degree of optimization, but they are very very far from polished works from a minmax perspective. Xykon, notably, seems to lack any means to directly counter Invisibility, which is a glaring hole for someone who prides himself on his ability to take out Wizards.
I, suppose, in a pinch, he Readies an Action to hit his best guess square with Supreme Dispelling. But that would suh-huck if he were tested at a gaming table rather than in a story.