<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def create_from_xmlfile(cls, xmlfile, extdir=None):
 """Create a Source object from an XML file. Parameters xmlfile : str Path to XML file. extdir : str Path to the extended source archive. """

        root = ElementTree.ElementTree(file=xmlfile).getroot()
        srcs = root.findall('source')
        if len(srcs) == 0:
            raise Exception('No sources found.')
        return cls.create_from_xml(srcs[0], extdir=extdir)