NamespaceRegistry nsRegistry = serContext.getNamespaceRegistry();
if (XOPContext.isXOPMessage())
{
XOPMarshaller xopMarshaller = new XOPMarshallerImpl();
XOPObject xopObject = new XOPObject(value);
xopObject.setContentType("application/octet-stream");
String cid = xopMarshaller.addMtomAttachment(xopObject, xmlName.getNamespaceURI(), xmlType.getLocalPart());
String xopInclude = "<xop:Include xmlns:xop='http://www.w3.org/2004/08/xop/include' href='" + cid + "'/>";
xmlFragment = wrapValueStr(xmlName, xopInclude, nsRegistry, null, attributes, false);
}
else