'Add a new child \'child\' with the name \'name\'.
If the optional flag \'force\' is set to True, the
child object is overwritten if it is already there.
This function returns the child object, whether
new or existing'

def addChild(self, name, force=False):

    if (type(name) != str):
        raise ValueError('Argument    should    be    a    string!')
    child = self.getChild(name)
    if child:
        if force:
            index = self.getIndex(child)
            if (index != (-1)):
                child = self.__class__(name)
                self._children[index] = child
                child.setParent(self)
                self.__setChildDict(child)
        return child
    else:
        child = self.__class__(name)
        child.setParent(self)
        self._children.append(child)
        self.__setChildDict(child)
        return child
