code: protected void iterateContributor(Counter counter, Element parent, java.util.Collection list,
              java.lang.String parentTag, java.lang.String childTag)
     {
        boolean shouldExist = (list != null) && (list.size() > 0);
        Element element = updateElement(counter, parent, parentTag, shouldExist);
        if (shouldExist)
        {
           Iterator it = list.iterator();
           Iterator elIt = element.getChildren(childTag, element.getNamespace()).iterator();
           if (!elIt.hasNext())
           {
              elIt = null;
           }
  
           Counter innerCount = new Counter(counter.getDepth() + 1);
           while (it.hasNext())
           {
              Contributor value = (Contributor) it.next();
              Element el;
              if ((elIt != null) && elIt.hasNext())
              {
                 el = (Element) elIt.next();
                 if (!elIt.hasNext())
                 {
                    elIt = null;
                 }
              }
              else
              {
                 el = factory.element(childTag, element.getNamespace());
                 insertAtPreferredLocation(element, el, innerCount);
              }
              updateContributor(value, childTag, innerCount, el);
              innerCount.increaseCount();
           }
           if (elIt != null)
           {
              while (elIt.hasNext())
              {
                 elIt.next();
                 elIt.remove();
              }
           }
        }
     }
docs: Method iterateContributor.
  
  @param counter
  @param childTag
  @param parentTag
  @param list
  @param parent