code: public void assignResource(XEvent event, String resource) {
  		if (resource != null && resource.trim().length() > 0) {
  			XAttributeLiteral attr = (XAttributeLiteral) ATTR_RESOURCE.clone();
  			attr.setValue(resource.trim());
  			event.getAttributes().put(KEY_RESOURCE, attr);
  		}
  	}
docs: Assigns the resource attribute value for a given event.
  
  @param event
  Event to be modified.
  @param resource
  Resource string to be assigned.