// to correctly find out about attachments.
try {
MutableXMLStreamBuffer xsb = new MutableXMLStreamBuffer();
AttachmentSetImpl attachments = new AttachmentSetImpl();
AttachmentMarshallerImpl am = new AttachmentMarshallerImpl(attachments);
bridge.marshal(jaxbObject,xsb.createFromXMLStreamWriter(), am);
am.cleanup();
// any way to reuse this XMLStreamBuffer in StreamMessage?