docs: public static <T extends XMLObject> T transformSamlObject(final OpenSamlConfigBean configBean, final byte[] data,
                                                                final Class<T> clazz) {
          try (InputStream in = new ByteArrayInputStream(data)) {
              val document = configBean.getParserPool().parse(in);
              val root = document.getDocumentElement();
              val marshaller = configBean.getUnmarshallerFactory().getUnmarshaller(root);
              if (marshaller != null) {
                  val result = marshaller.unmarshall(root);
                  if (!clazz.isAssignableFrom(result.getClass())) {
                      throw new ClassCastException("Result [" + result + " is of type " + result.getClass() + " when we were expecting " + clazz);
                  }
                  return (T) result;
              }
          } catch (final Exception e) {
              throw new SamlException(e.getMessage(), e);
          }
          return null;
      }