it displays nothing even if the query cannot produce any result
There are many queries that cannot produce any result. An example would be
//employee[hire-date gt current-date()]
There is no way, of course, that the system can know that all employees have a hire-date in the past, so this query will simply return nothing, and you will have to figure out why.
But perhaps you mistyped "hire-date". Perhaps it should have been "hireDate" or "@hire-date"? In this case you might expect that the system would be able to spot your error. The answer is that it can, provided you use a query processor that is schema-aware, and that you take advantage of the schema awareness by telling the query processor about your schema (typically with an "import schema" declaration in the query prolog).
It can be a bit of a pain to use schema-awareness for simple ad-hoc queries, which is probably why most people don't bother. But if you are developing something complex, it can be a real help in making debugging easier - particularly for the "blank screen" problem where your query returns nothing, and there is no way of finding out why except by staring at it until the light dawns.
An example of a schema-aware query processor that uses the schema to detect errors at compile time is Saxon-EE.