def setdocument(self, doc):
<EOL>if self.document != doc:<EOL><INDENT>self.document = doc<EOL>for i in self.children:<EOL><INDENT>if not isinstance(i, dom_tag): return<EOL>i.setdocument(doc)<EOL><DEDENT><DEDENT>
Creates a reference to the parent document to allow for partial-tree
validation.