OMFactory factory = new OMLinkedListImplFactory();
OMElement message = factory.createOMElement(SyslogConstants.MESSAGE);
message.addAttribute(factory.createOMAttribute(SyslogConstants.FACILITY, null, facility));
message.addAttribute(factory.createOMAttribute(SyslogConstants.SEVERITY, null, severity));
if (tag != null) {
message.addAttribute(factory.createOMAttribute(SyslogConstants.TAG, null, tag));
}
if (pid != -1) {
message.addAttribute(factory.createOMAttribute(SyslogConstants.PID, null, String.valueOf(pid)));
}
message.setText(content);