def METHOD_NAME(self, template_path, template_type):
    """Load a package info template in Info.plist or PackageInfo format."""
    if template_path.endswith(".plist"):
        # Try to load Info.plist in bundle format.
        try:
            with open(self.env["template_path"], "rb") as f:
                info = plistlib.load(f)
        except Exception:
            raise ProcessorError(
                f"Malformed Info.plist template {self.env['template_path']}"
            )
        if template_type == "bundle":
            return info
        else:
            return self.convert_bundle_info_to_flat(info)
    else:
        # Try to load PackageInfo in flat format.
        try:
            info = ElementTree.parse(template_path)
        except Exception:
            raise ProcessorError(
                f"Malformed PackageInfo template {self.env['template_path']}"
            )
        if template_type == "flat":
            return info
        else:
            return self.convert_flat_info_to_bundle(info)