Every time that I run across the diversity answer export it gives me trouble. So I suppose it’s time to document it. To find the variables do an export on DiverstityAnswers targeting the Question and PossibleAnswer related tables. You can then sub them into this projection:

<quer:projection id="idGender" alias="USAEEO2Gender" xmlns:quer="http://www.taleo.com/ws/integration/query">
  <quer:query projectedClass="Candidate" alias="EEO2b_Gender">
    <quer:projections>
      <quer:projection alias="EEO2b_Gender">
        <quer:decode>
          <quer:field path="DiversityAnswers,PossibleAnswer,Sequence"/>
          <quer:integer>2</quer:integer>
          <quer:string>M</quer:string>
          <quer:integer>3</quer:integer>
          <quer:string>F</quer:string>
          <quer:integer>4</quer:integer>
          <quer:string>U</quer:string>
        </quer:decode>
      </quer:projection>
    </quer:projections>
    <quer:filterings>
      <quer:filtering>
        <quer:equal>
          <quer:field path="DiversityAnswers,Question,Code"/>
          <quer:string>EEO2b Gender</quer:string>
        </quer:equal>
      </quer:filtering>
      <quer:filtering>
        <quer:equal>
          <quer:field path="Number"/>
          <quer:field ownerQuery="NewHire" path="Candidate"/>
        </quer:equal>
      </quer:filtering>
    </quer:filterings>
  </quer:query>
</quer:projection>