code: def _clean_text(self, branch):
          
          if branch.text and self.input_text_formatter:
              branch.text = self.input_text_formatter(branch.text)
          try:
              for child in branch:
                  self._clean_text(child)
                  if branch.text and branch.text.find(child.text) >= 0:
                      branch.text = branch.text.replace(child.text, '', 1)
          except TypeError:  # not an iterable node
              pass
docs: Remove text from node if same text exists in its children.
              Apply string formatter if set.