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)
Create a Source object from an XML file.

        Parameters
        ----------
        xmlfile : str
            Path to XML file.

        extdir : str
            Path to the extended source archive.