It's hard to find a good example of how to verify SAML signatures online. There are plenty magic that "just calls a Java method" -- but few clear step-by-step guide.
This gist covers the signature check of a SAML response in Ruby, and as such it's also an example of how to verify an XML Secure.
The code here is lifted entirely from Morten Primdahls and Zendesks awesome SAMLR library.