if (protocol!=null) {
String sDest = getDestinations(protocol);
sb.append("<protocol type=\"").append(protocol.getKind()).append("\" flags=\"").append(protocol.getFlags()).append("\"").append(sDest!=null? " destinations=\"" +sDest+ "\"": "").append(" adHoc=\"" +protocol.getAdHoc()+ "\"").append(">");
StringAttributeMap attributes = protocol.extractAttributeMap();
for (String key : attributes.keySet()) {
StringAttribute value = attributes.get(key);
sb.append("<").append(key).append(">").append(value.getValue()).
append("</").append(key).append(">");
}