code: def pop(self, arg=None):
          
          self._stable = False
          if arg is None:
              arg = len(self.childs) - 1
          if isinstance(arg, int):
              try:
                  result = self.childs.pop(arg)
              except IndexError:
                  raise DOMModByIndexError(self, "Given index invalid.")
              if isinstance(result, DOMElement):
                  result.parent = None
          else:
              result = []
              if isinstance(arg, str):
                  arg = [arg]
              for x in arg:
                  try:
                      result.append(getattr(self, x))
                  except AttributeError:
                      raise DOMModByKeyError(
                          self, "Given search key invalid. No child found."
                      )
              if result:
                  for x in result:
                      self.childs.remove(x)
                      if isinstance(x, DOMElement):
                          x.parent = False
          return result
docs: Removes the child at given position or by name (or name iterator).
              if no argument is given removes the last.