code: def postappend(self):
          
  
          #If the element was not associated with a document yet, do so now (and for all unassociated children:
          if not self.doc and self.parent.doc:
              self.setdocument(self.parent.doc)
  
          if self.doc and self.doc.deepvalidation:
              self.deepvalidation()
docs: This method will be called after an element is added to another and does some checks.
  
          It can do extra checks and if necessary raise exceptions to prevent addition. By default makes sure the right document is associated.
  
          This method is mostly for internal use.