code: def generate_legacy_webfinger(template=None, *args, **kwargs):
      
      if template == "diaspora":
          webfinger = DiasporaWebFinger(*args, **kwargs)
      else:
          webfinger = BaseLegacyWebFinger(*args, **kwargs)
      return webfinger.render()
docs: Generate a legacy webfinger XRD document.
  
      Template specific key-value pairs need to be passed as ``kwargs``, see classes.
  
      :arg template: Ready template to fill with args, for example "diaspora" (optional)
      :returns: Rendered XRD document (str)