I found a great workaround for building with jenkins.
Firstly, before setting up a job, download a jenkins plugin called:
Parameterized Trigger Plugin
Once you do that, create your job and while creating the job, select the
'This build is parameterized' checkbox
Create a String Parameter. I called mine CODE_SIGN_IDENTITY.
So the name field in the String Parameter should be:
Default Value: iPhone Developer: XXX XXXXX
Description: Whatever you want to put there
Then in your Xcode Plugin, find the 'Custom xcodebuild arguments' field.
In the Custom xcodebuild arguments field, place the following value:
Finish setting up your job and you should be all set!
This will bypass the white space issue. The plugin is a life saver as it works wonderfully and you can customize your build with other parameters.