This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
In section 5.8.1 Constructing Complex Content, we write in step 7 [ERR XTDE0420] It is a dynamic error if the result sequence used to construct the content of a document node contains a namespace node or attribute node. However, in step 4 we write: 4. Any document node within the result sequence is replaced by a sequence containing each of its children, in document order. So, after step 4 we have removed the document nodes. While I understand that this rule is here to prevent a document node to have namespace or attribute nodes, in an earlier step we have already removed any document nodes, resulting in this error never being thrown. I think the effect is depth-first, which means that we can only reach step 4 after in a previous cycle we reached step 7 for the children. Perhaps we can swap these rules for clarity?
XTDE0420 is about constructing document nodes, it applies when the containing instruction is xsl:document, xsl:result-document, or xsl:copy with the context item being a document node. This has nothing to do with whether the value of the sequence delivered by the sequence constructor contains any document nodes; furthermore replacing a document node by its children will never cause the sequence to contain attribute or namespace nodes because they cannot occur as children of a document node.
Let's close this with no action. The ambiguity came from a recent scan through this section. We implemented it the way you describe it, so there are no practical implications.