docs: public static StringWriter transformSamlObject(final OpenSamlConfigBean configBean, final XMLObject samlObject,
                                                     final boolean indent) throws SamlException {
          val writer = new StringWriter();
          try {
              val marshaller = configBean.getMarshallerFactory().getMarshaller(samlObject.getElementQName());
              if (marshaller != null) {
                  val element = marshaller.marshall(samlObject);
                  val domSource = new DOMSource(element);
  
                  val result = new StreamResult(writer);
                  val tf = TransformerFactory.newInstance();
                  tf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
                  val transformer = tf.newTransformer();
  
                  if (indent) {
                      transformer.setOutputProperty(OutputKeys.INDENT, "yes");
                      transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
                  }
                  transformer.transform(domSource, result);
              }
          } catch (final Exception e) {
              throw new SamlException(e.getMessage(), e);
          }
          return writer;
      }