code: def doc(self):
          
          guess = self
          while guess is not None and guess.tag != 'Doc':
              guess = guess.parent  # If no parent, this will be None
          return guess
docs: Return the root Doc element (if there is one)