Changes the way the SAML metadata are generated

- Fixes the attributed for the signing cert
- Adds proper encoding
- Changes the way the XML is build in order to add nodes in a more
  flexible way