def METHOD_NAME(self):
    distro_xml = E.distro(
        E.tree(url=self.tree_url),
        E.kernel(url=self.kernel_path),
        E.initrd(url=self.initrd_path),
        E.arch(value=self.arch.arch),
        E.osversion(major=self.osmajor, minor=self.osminor)
    )
    if self.distro_name:
        distro_xml.append(E.name(value=self.distro_name))
    if self.variant:
        distro_xml.append(E.variant(value=self.variant))
    return distro_xml