<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def loadACatalog(filename):
 """Load the catalog and build the associated data structures. This can be either an XML Catalog or an SGML Catalog It will recurse in SGML CATALOG entries. On the other hand XML Catalogs are not handled recursively. """

    ret = libxml2mod.xmlLoadACatalog(filename)
    if ret is None:raise treeError('xmlLoadACatalog() failed')
    return catalog(_obj=ret)