You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: api2_helper.rb
    path of file: ./repos/mushroom-observer/app/helpers
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

#
#  = API2 Helpers
#
#  Methods available to API XML responses.
#
#######
    
  def xml_detailed_object(xml, tag, object)
    return if object.blank?

    type = object.type_tag.to_s
    xml.tag!(tag, id: object.id, type: type) do |inner_xml|
      send(:"xml_#{type}", inner_xml, object)
    end
  end