However, that's true only when returning the entire XML value. The query() method retrieves a subset of untyped XML from the target XML instance. location within the document, I would have received a violation error.
Since the OP didn't explicitly use the query() method, please show us what you mean and why YOU would have received a "violation error".
--Jeff Moden
Change is inevitable... Change for the better is not.