code: public byte[] convertToXmlByteArray(
              BucketNotificationConfiguration notificationConfiguration) {
          XmlWriter xml = new XmlWriter();
          xml.start("NotificationConfiguration", "xmlns", Constants.XML_NAMESPACE);
          Map<String, NotificationConfiguration> configurations = notificationConfiguration
                  .getConfigurations();
  
          for (Map.Entry<String, NotificationConfiguration> entry : configurations
                  .entrySet()) {
              String configName = entry.getKey();
              NotificationConfiguration config = entry.getValue();
              if (config instanceof TopicConfiguration) {
                  xml.start("TopicConfiguration");
                  xml.start("Id").value(configName).end();
                  xml.start("Topic")
                          .value(((TopicConfiguration) config).getTopicARN())
                          .end();
                  addEventsAndFilterCriteria(xml, config);
                  xml.end();
              } else if (config instanceof QueueConfiguration) {
                  xml.start("QueueConfiguration");
                  xml.start("Id").value(configName).end();
                  xml.start("Queue")
                          .value(((QueueConfiguration) config).getQueueARN())
                          .end();
                  addEventsAndFilterCriteria(xml, config);
                  xml.end();
              } else if (config instanceof CloudFunctionConfiguration) {
                  xml.start("CloudFunctionConfiguration");
                  xml.start("Id").value(configName).end();
                  xml.start("InvocationRole")
                          .value(((CloudFunctionConfiguration) config)
                                  .getInvocationRoleARN()).end();
                  xml.start("CloudFunction")
                          .value(((CloudFunctionConfiguration) config).getCloudFunctionARN())
                          .end();
                  addEventsAndFilterCriteria(xml, config);
                  xml.end();
              } else if (config instanceof LambdaConfiguration) {
                  xml.start("CloudFunctionConfiguration");
                  xml.start("Id").value(configName).end();
                  xml.start("CloudFunction")
                          .value(((LambdaConfiguration) config).getFunctionARN())
                          .end();
                  addEventsAndFilterCriteria(xml, config);
                  xml.end();
              }
          }
          xml.end();
          return xml.getBytes();
      }
docs: Converts the specified notification configuration into an XML byte array.
  
  @param notificationConfiguration
  The configuration to convert.
  
  @return The XML byte array representation.