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: staging_controller.rb
    path of file: ./repos/open-build-service/src/api/app/controllers/staging
    
    the code of the file until where you have to start completion: module Staging
  class StagingController < ApplicationController
    private

    def set_project
      @project = Project.get_by_name(params[:staging_workflow_project])
    rescue Project::UnknownObjectError
      render_error status: 404, mes
    
    def set_staging_workflow
      @staging_workflow = @project.staging
      return if @staging_workflow

      render_error status: 404, message: "Project #{@project} doesn't have an associated Staging Workflow"
    end

    def set_xml_hash
      request_body = request.body.read
      @parsed_xml = (Xmlhash.parse(request_body) || {}).with_indifferent_access if request_body.present?
      return if @parsed_xml.present?

      error_options = if request_body.present?
                        { status: 400, errorcode: 'invalid_xml_format', message: 'XML format is not valid' }
                      else
                        { status: 400, errorcode: 'invalid_request', message: 'Empty body' }
                      end
      render_error(error_options)
    end