<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def htmlNewDoc(URI, ExternalID):
 """Creates a new HTML document """

    ret = libxml2mod.htmlNewDoc(URI, ExternalID)
    if ret is None:raise treeError('htmlNewDoc() failed')
    return xmlDoc(_obj=ret)