mediaTypeParameters.put("type", "text/xml");
MediaType xopRootMediaType = new MediaType("application",
"xop+xml", mediaTypeParameters);
Marshaller marshaller = getMarshaller(type, annotations,
xopRootMediaType);
marshaller.setAttachmentMarshaller(new XopAttachmentMarshaller(
xopPackage));
ByteArrayOutputStream xml = new ByteArrayOutputStream();
marshaller.marshal(t, xml);
OutputPart outputPart = xopPackage.addPart(xml.toByteArray(),
xopRootMediaType, ContentIDUtils.generateContentID(), null);
List<OutputPart> outputParts = xopPackage.getParts();
outputParts.remove(outputPart);