code: public byte[] convertToXmlByteArray(BucketProtectionConfiguration config) throws SdkClientException {
  
          XmlWriter xml = new XmlWriter();
          xml.start("ProtectionConfiguration");
  
          // Status
          addParameterIfNotNull(xml, "Status", config.getStatus());
          
          // Minimum retention
          xml.start("MinimumRetention");
          if(config.getMinimumRetentionInDays() != null) {
          	String days = Integer.toString(config.getMinimumRetentionInDays());
          	addParameterIfNotNull(xml, "Days", days);
          }
          xml.end();
          
          // Default retention
          xml.start("DefaultRetention");
          if(config.getDefaultRetentionInDays() != null) {
          	String days = Integer.toString(config.getDefaultRetentionInDays());
          	addParameterIfNotNull(xml, "Days", days);
          }
          xml.end();
          
          // Maximum retention
          xml.start("MaximumRetention");
          if(config.getMaximumRetentionInDays() != null) {
          	String days = Integer.toString(config.getMaximumRetentionInDays());
          	addParameterIfNotNull(xml, "Days", days);
          }
          xml.end();
          
          // Permanent retention
          Boolean permanentRetentionEnabled = config.isPermanentRetentionEnabled();
          if (permanentRetentionEnabled != null) {
          	xml.start("EnablePermanentRetention")
          		.value(permanentRetentionEnabled.toString()).end();
          }
          
          xml.end();
  
          return xml.getBytes();
      }
docs: /*
  <ProtectionConfiguration>
  <Status>Retention</Status>
  <MinimumRetention>
  <Days>10</Days>
  </MinimumRetention>
  <DefaultRetention>
  <Days>100</Days>
  </DefaultRetention>
  <MaximumRetention>
  <Days>1000</Days>
  </MaximumRetention>
  <EnablePermanentRetention>True</EnablePermanentRetention>
  </ProtectionConfiguration>