public static void serialiseFieldsInPayload(XMLNamespaceContext namespaces, Payload p, Element parent, Document xmldoc) {
Map<String, Field> fieldDefinitions = p.getFieldDefinitions();
for (String fieldName : fieldDefinitions.keySet()) {
Field field = fieldDefinitions.get(fieldName);
FieldType fieldType = field.getTypeEnum();
Logger.trace("===== Processing field: " + field.getName() + " - type specified as: " + fieldType.name() + " multiplicity = " + field.getMaxOccurs());
FieldHandler handler = fieldType.getHandler();
String xpath = field.getXpath();
String strValue = null;
Object fieldValue = p.getValue(field.getName());