code: public byte[] convertToXmlByteArray(BucketCrossOriginConfiguration config) throws SdkClientException {
  
          XmlWriter xml = new XmlWriter();
          xml.start("CORSConfiguration", "xmlns", Constants.XML_NAMESPACE);
  
          for (CORSRule rule : config.getRules()) {
              writeRule(xml, rule);
          }
  
          xml.end();
  
          return xml.getBytes();
      }
docs: /*
  <CORSConfiguration>
  <CORSRule>
  <AllowedOrigin>http://www.foobar.com</AllowedOrigin>
  <AllowedMethod>GET</AllowedMethod>
  <MaxAgeSeconds>3000</MaxAgeSec>
  <ExposeHeader>x-amz-server-side-encryption</ExposeHeader>
  </CORSRule>
  </CORSConfiguration>