The type cast is used to avoid runtime errors, but there are several reasonable limitations:
An object of a specific schema type can be cast only to a subtype. This applies to elements, attributes, variables and message parts. The XML Schema has two derivations, extension and restriction, both of which are supported by type cast.
xsd:any contains additional attributes which might restrict the possible element type.
Only global types can be used when you declare a pseudo-component. Global attributes or elements cannot be used. The target of the type must be referencable, and as such should be global.
You cannot nest type casts, pseudo-components, and mixed declarations.
You cannot add a new predicate to a casted component or its part.
You cannot mix two or more type casts or pseudo components in an XPath expression. A type cast cannot be associated with a specific part of an expression, but only with the expression as a whole.