Questiosn with XY problems should generally not be closed. An XY problem usually has nothing to do with the validity of the question, just the helpfulness of a question.
A question should probably not be closed for being an XY question per se - although there are various good close reasons that could be described as an XY question if you squint hard.
- Real problem - "I can't be arsed to read the rulebook"
- Real problem - "My thought processes are terminally disordered"
- Real problem - "I am randomly curious about a hypothetical"
Remember, good questions are about actual problems that you face. I'll call this a "meta" X-Y problem - it's not that they are asking about Monkey Grip when they really want to know about maximizing DPS, it's that they are cosmically troubled in some other way.
In general more routine non-meta-scoped XY problems cancan be comment-clarified and downvoted, and answered with a frame-challenge (subject to voting if people think it's valid or not) if it's merited within the narrow guidelines already expressed here on meta.
There's nothing wrong with encouraging people to give context as to why they're trying to do what they do, because they may not be sure how to reach their goal (they are asking, after all) and need to either edit their question or ask another - a good example is "I want to ask a question about how to use monkey grip because I want the best dps ever" - you can go ahead and answer how to use monkey grip, and that's a legitimate question and a legitimate answer, but they may not be a good question and a good answer because they don't solve the problem. I would consider a frame-challenge an appropriate possible answer to that question. Close votes on the question would not be appropriate, however.
TL;DR:
- Valid close reason - "unclear what you're asking"
- Invalid close reason - "I don't like what you're asking"