<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def addChild(self, cur):
 """Add a new node to @parent, at the end of the child (or property) list merging adjacent TEXT nodes (in which case @cur is freed) If the new node is ATTRIBUTE, it is added into properties instead of children. If there is an attribute with equal name, it is first destroyed. """

        if cur is None: cur__o = None
        else: cur__o = cur._o
        ret = libxml2mod.xmlAddChild(self._o, cur__o)
        if ret is None:raise treeError('xmlAddChild() failed')
        __tmp = xmlNode(_obj=ret)
        return __tmp