The language of Turing machines that accept exactly $k$ inputs For a fixed $k\geq 0$, let $X_k = \{\langle M\rangle\mid |L(M)|=k\}$, where $\langle M\rangle$ is the encoding of a Turing machine&nbsp;$M$ and $L(M)$ is the language $M$&nbsp;accepts.  Is $X_k$ recursive, recursively enumerable or neither?

I think $X_k$ is NOT recursively enumerable because even if you generate every possible string, and test each one, if you find $k$ strings that M accepts, you still have to check every other string (in case $M$ accepts more than $k$ strings), which means your machine will loop indefinitely, and never find a yes-instance. However I'm not sure how you would show this, initially I thought I could reduce the NHP (Not Halting Problem) to L but that didn't go too well. Any ideas?
Hint: to decide whether $M$&nbsp;halts on input&nbsp;$w$, consider a new machine&nbsp;$M'$ that rejects every input except&nbsp;$w$ and simulates&nbsp;$M$, otherwise. That's not quite the answer but it should get you close enough.