function formatSecureStopCDMData(encodedSessionId, customData, encodedPublisherCert) {
        var rgbCustomData = stringToByteArray(customData, true);
        var uint16arrayCustomData = new Uint16Array(rgbCustomData);
        var customDataW = String.fromCharCode.apply(null, uint16arrayCustomData);
        var encodedCustomData = btoa(customDataW);

        var cmdData    = "<PlayReadyCDMData type=\"SecureStop\">" +
                         "<SecureStop version=\"1.0\" >" +
                         "<SessionID>" + encodedSessionId + "</SessionID>" +
                         "<CustomData>" + customData + "</CustomData>" +
                         "<ServerCert>" + encodedPublisherCert + "</ServerCert>" +
                         "</SecureStop></PlayReadyCDMData>";

        var rgbCDMData = stringToByteArray(cmdData, true);
        var int8ArrayCDMdata = new Uint8Array(rgbCDMData);

        return int8ArrayCDMdata;
    }
desc@ formatSecureStopCDMData
  generate playready CDMData
  CDMData is in xml format:
  <PlayReadyCDMData type="SecureStop">
    <SecureStop version="1.0">
      <SessionID>B64 encoded session ID</SessionID>
      <CustomData>B64 encoded custom data</CustomData>
      <ServerCert>B64 encoded server cert</ServerCert>
    </SecureCert>
</PlayReadyCDMData>