Chris@0: xml.instruct! Chris@0: xml.projects :type => 'array' do Chris@0: @projects.each do |project| Chris@0: xml.project do Chris@0: xml.id project.id Chris@0: xml.name project.name Chris@0: xml.identifier project.identifier Chris@0: xml.description project.description Chris@0: xml.parent(:id => project.parent_id, :name => project.parent.name) unless project.parent.nil? Chris@0: xml.custom_fields do Chris@0: project.custom_field_values.each do |custom_value| Chris@0: xml.custom_field custom_value.value, :id => custom_value.custom_field_id, :name => custom_value.custom_field.name Chris@0: end Chris@0: end unless project.custom_field_values.empty? Chris@0: xml.created_on project.created_on Chris@0: xml.updated_on project.updated_on Chris@0: end Chris@0: end Chris@0: end