Fix for Tivoli Identity Manager

I had problem recently using saml-ruby logging in from a Tivoli Identity Manager. In order to get the authentication to complete, I had to make the changes in this commit. My understanding of the inner workings of the lib/xml_security.rb file is really non-existent and I have no idea if this is causing any issues with security or something else.

Can someone please have a look at see if I've improved things or severely broken them. Thank you.