d Abstract) Dario Colazzo1 , Giorgio Ghelli2 , Paolo Manghi2 , and Carlo Sartiani2 1 LRI - Universit?e Paris Sud 2 Dipartimento di Informatica - Universit`a di Pisa If a subexpression in a query will never contribute data to the query answer, this should be regarded as an error. This principle has been recently accepted into mainstream XML query languages, but was still waiting for a complete treatment. We provide here a precise definition for this class of errors, and define a type system that is sound and complete, in its search for such errors, for a core language, under mild restrictions on the use of recursion in type definitions.