class GenericAttributeContent {

    public String generateContent(Map<String, String> properties) {
        if (properties.size() == 0) return "<" + elementName + "/>";

        StringBuilder sb = new StringBuilder();
        sb.append("<" + elementName + ">\r\n");
        for (Map.Entry<String, String> entry: properties.entrySet()) {
            String key = entry.getKey();
            sb.append("  <field>\r\n");
            if (key != null) {
                sb.append("    <name>" + key + "</name>\r\n");
            } else {
                log.warn("null key encountered");
            }
            String value = entry.getValue();
            if (value != null) {
                sb.append("    <value>" + entry.getValue() + "</value>\r\n");
            } else {
                log.warn("null value encountered for key: " + key);
            }
            sb.append("  </field>\r\n");
        }
        sb.append("</" + elementName + ">\r\n");

        return sb.toString();
    }

    public  GenericAttributeContent(Class clazz);
    public  GenericAttributeContent(String elementName);

}