ByteArrayOutputStream osBuf = new ByteArrayOutputStream();
// use context variable `role' as this request's XML/A role
String roleName = (String) context.get(CONTEXT_ROLE_NAME);
Role role = (Role) context.get(CONTEXT_ROLE);
XmlaRequest xmlaReq;
if (role != null) {
xmlaReq = new DefaultXmlaRequest(xmlaReqElem, role);
} else if (roleName != null) {