I struggle with this a lot to be honest. In another comment in this comment section I've mentioned working with a technology; while working with it, I run into an issue and I'd like to resolve the issue.
But the issue I'm running into now may be a dealbreaker for continuing to work with the technology; that is, if I were to ask someone neutral, they would tell me the technology isn't suitable for my use case.
The main thing with the XY problem is that if I'm told that it's my technology choice, architecture or solution direction is wrong, I have to consider whether to replace, re-architect or rewrite big chunks of my application.
I mean in my case it's an investment of days, but there's bigger applications out there where we're talking in work-years. And for a manager, or in my case someone who has to balance his own time for the most part, that's a difficult decision to make that shouldn't be taken lightly.
So please, while the XY problem is indeed an issue, start a reply by just answering the question; "how do I do x" SHOULD be a straightforward question in a lot of cases.
In the second half of a reply, as this article implies, you can point out that you suspect that the question isn't the real underlying issue. Have the person asking the question decide for themselves what to do with that information.