Index: /main/trunk/gli/src/org/greenstone/gatherer/cdm/CollectionConfigXMLReadWrite.java
===================================================================
--- /main/trunk/gli/src/org/greenstone/gatherer/cdm/CollectionConfigXMLReadWrite.java	(revision 25729)
+++ /main/trunk/gli/src/org/greenstone/gatherer/cdm/CollectionConfigXMLReadWrite.java	(revision 25730)
@@ -31,4 +31,8 @@
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
 import java.util.StringTokenizer;
 
@@ -1161,32 +1165,32 @@
 		Element destination = to.getDocumentElement();
 
-		String[] att_values = { StaticStrings.COLLECTIONMETADATA_COLLECTIONEXTRA_STR, StaticStrings.COLLECTIONMETADATA_ICONCOLLECTIONSMALL_STR, StaticStrings.COLLECTIONMETADATA_ICONCOLLECTION_STR, StaticStrings.COLLECTIONMETADATA_COLLECTIONNAME_STR };
-
-		String[] map_attrs = { StaticStrings.DESCRIPTION_STR, StaticStrings.SMALLICON_STR, StaticStrings.ICON_STR, StaticStrings.NAME_STR };
-
-		for (int i = 0; i < att_values.length; i++)
-		{
-
-			//dOc
-			ArrayList e_list = XMLTools.getNamedElementList(from.getDocumentElement(), StaticStrings.COLLECTIONMETADATA_ELEMENT, StaticStrings.NAME_ATTRIBUTE, att_values[i]);
-			// if such elements don't exist, don't bother
-			if (e_list == null)
-			{
-				continue;
-			}
-			for (int j = 0; j < e_list.size(); j++)
-			{
-				Element e = (Element) e_list.get(j);
-				if (e.getAttribute(StaticStrings.ASSIGNED_ATTRIBUTE).equals(StaticStrings.FALSE_STR))
-				{
-					continue;
-				}
-				String text = XMLTools.getNodeText(e);
-				String lang = e.getAttribute(StaticStrings.LANGUAGE_ATTRIBUTE);
-
-				Element displayItem = constructElement(StaticStrings.DISPLAYITEM_STR, map_attrs[i], StaticStrings.LANG_STR, lang, text, to);
-				displayItemList.appendChild(displayItem);
-			}
-
+		Map attributeMap = new HashMap(4);
+		attributeMap.put(StaticStrings.COLLECTIONMETADATA_COLLECTIONEXTRA_STR,StaticStrings.DESCRIPTION_STR);
+		attributeMap.put(StaticStrings.COLLECTIONMETADATA_COLLECTIONNAME_STR,StaticStrings.NAME_STR);
+		attributeMap.put(StaticStrings.COLLECTIONMETADATA_ICONCOLLECTIONSMALL_STR,StaticStrings.SMALLICON_STR);
+		attributeMap.put(StaticStrings.COLLECTIONMETADATA_ICONCOLLECTION_STR,StaticStrings.ICON_STR);
+
+		NodeList e_list = from.getDocumentElement().getElementsByTagName(StaticStrings.COLLECTIONMETADATA_ELEMENT);
+		// if such elements don't exist, don't bother
+		if (e_list != null) { 
+		    
+		    for (int j = 0; j < e_list.getLength(); j++) {
+			Element e = (Element) e_list.item(j);
+			if (e.getAttribute(StaticStrings.ASSIGNED_ATTRIBUTE).equals(StaticStrings.FALSE_STR)) {
+			    continue;
+			}
+			String text = XMLTools.getNodeText(e);
+			String lang = e.getAttribute(StaticStrings.LANGUAGE_ATTRIBUTE);
+			String name_value = e.getAttribute(StaticStrings.NAME_ATTRIBUTE);
+			
+			String name_mapping = (String)attributeMap.get(name_value);
+			if(name_mapping != null) {
+			    name_value = name_mapping;
+			}
+
+			Element displayItem = constructElement(StaticStrings.DISPLAYITEM_STR, name_value, StaticStrings.LANG_STR, lang, text, to);
+			displayItemList.appendChild(displayItem);
+		    }
+		    
 		}
 		destination.appendChild(displayItemList);
@@ -2334,4 +2338,36 @@
 		}
 
+		if (displayItemListNode != null)
+		{
+
+		    NodeList nl = ((Element)displayItemListNode).getElementsByTagName(StaticStrings.DISPLAYITEM_STR);
+
+		    // make a list of all unique attribute names that are specifically not
+		    // description, smallicon, icon and name, since these are already processed above
+		    Set setOfUniqueDisplayItemNames = new LinkedHashSet();
+		    for(int i = 0; i < nl.getLength(); i++) {
+			Element displayItem = (Element)nl.item(i);
+			String name = displayItem.getAttribute(StaticStrings.NAME_ATTRIBUTE);
+
+			if(name.equals("")) continue; // no name attribute
+
+			if(name.equals(StaticStrings.DESCRIPTION_STR)) continue;
+			if(name.equals(StaticStrings.SMALLICON_STR)) continue;
+			if(name.equals(StaticStrings.ICON_STR)) continue;
+			if(name.equals(StaticStrings.NAME_STR)) continue;
+
+			// otherwise
+			setOfUniqueDisplayItemNames.add(name); // Set will ensure no duplicate names
+		    }
+		    
+		    Iterator i = setOfUniqueDisplayItemNames.iterator();
+		    while (i.hasNext()) {
+			String displayItemName = (String)i.next();
+
+			ArrayList custom_displayItem = doDisplayItemList(dOc, displayItemListNode, displayItemName, displayItemName);		
+			appendArrayList(toElement, custom_displayItem);
+		    }
+		}
+
 		if (buildtype_value.equalsIgnoreCase("mg"))
 		{
