I've seen this argument often enough, especially on IRC, where people smugly assume that there must be a flaw in what the person asking a question is trying to do. Problem with this is, a lot of times, I
just want the answer to a direct question, which I can't find easily in the docs (or maybe it's not documented).
Only, more often than not, people think they always know better and everyone asking a question must either not know the proper way of doing things, and why in the world are they trying to do <question_asked> ? This then leads to a debate about me trying to solve problem X which requires me to solve Y which requires me to do Z, which led me to ask the question. At the end, I get the exact answer I was looking for, but that took longer than necessary because other were looking at it the same way you described, that it's the XY problem. I can't help but feel that it mostly just wasted my time a lot.
You don't always have to know the entire story behind the code to give straight answers, is all I'm saying. :)