if (query.getRole() != null) {
Attribute roleAttribute = new Attribute("role", query.getRole());
qElement.setAttribute(roleAttribute);
}
else{
throw new RequiredAttributeMissingException("If declaring a Query element, the field 'role' must be be specified");
}
if(query.getOsd() != null){
Attribute osd = new Attribute("osd", query.getOsd());
qElement.setAttribute(osd);