I'm using the spring integration xmpp module to write a custom implementation of a 3rd party Server connecting to GCM cloud services, as in [GCM Cloud Connection Server (XMPP)](https://developer.android.com/google/gcm/ccs.html). 

So far I've successfully connected to the GCM server, however when I send a message to the server I end up with something like:

```
<message id="m-1366082849205" to="REGISTRATION_ID">
<body>{"hello":"world"}</body>
</message>

```

, but I need to send something like this:

```
  <message id="">
  <gcm xmlns="google:mobile:data">
  {
      "to":"REGISTRATION_ID",
      "message_id":"m-1366082849205"
      "data":
      {
          "hello":"world",
      }
  }
  </gcm>
</message>

```

I use the latest SI version, 4.0.4, this is my configuration in the xml:

```
<int-xmpp:outbound-channel-adapter
    id="gcmOutboundAdapter" channel="gcmOutboundNotificationChannel"
    xmpp-connection="gcmConnection" auto-startup="true"/>

```

I'm sending messages with the usual MessageBuilder like this:

```
Message<String> xmppOutboundMsg = MessageBuilder.withPayload(xmppPayload)
        .setHeader(XmppHeaders.TO, REGISTRATION_ID)
        .build();

```

where xmppPayload is a json string.

I need to configure/override the way the xmpp message is composed, what is the best practice to achieve the result? Should I override the class implementing int-xmpp:outbound-channel-adapter with a custom service activator, is there anyway to configure the way the xmpp message is composed?

Thanks for any help.