<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def copyDoc(self, recursive):
 """Do a copy of the document info. If recursive, the content tree will be copied too as well as DTD, namespaces and entities. """

        ret = libxml2mod.xmlCopyDoc(self._o, recursive)
        if ret is None:raise treeError('xmlCopyDoc() failed')
        __tmp = xmlDoc(_obj=ret)
        return __tmp