Code example for DOMImplementationLS

Methods: createLSOutputcreateLSSerializer

			Element element = marshaller.marshall(xmlObject);
			ByteArrayOutputStream byteArrayOutputStrm = new ByteArrayOutputStream();
			DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance();
			DOMImplementationLS impl = (DOMImplementationLS) registry.getDOMImplementation("LS");
			LSSerializer writer = impl.createLSSerializer();
			LSOutput output = impl.createLSOutput();
			writer.write(element, output);
			return byteArrayOutputStrm.toString();
		} catch (Exception e) {
			log.error("Error Serializing the SAML Response");
			throw new SAML2SSOUIAuthenticatorException("Error Serializing the SAML Response", e);
	 * Compressing and Encoding the response 
	 * @param xmlString 
Connect your IDE to all the code out there  Get Codota for Java