if (!rs.isEmpty ()) { for (Iterator iter = rs.iterator (); iter.hasNext (); ) { TimeSpan elem = (TimeSpan) iter.next (); Element value = createValue (doc); listTag.appendChild (value); value.appendChild (createLittleInterval (doc, new Date (elem.getStartTime ()), new Date (elem.getEndTime   ()))); }
List copy = new ArrayList (rs);  for (Iterator iter = copy.iterator (); iter.hasNext (); ) { TimeSpan elem = (TimeSpan) iter.next (); Element value = createValue (doc); listTag.appendChild (value); value.appendChild (createLittleInterval (doc, new Date (elem.getStartTime ()), new Date (elem.getEndTime   ())));
  protected Element createInterval (Document doc,									RoleSchedule rs) {    Element fieldElem = doc.createElement("FIELD");	fieldElem.setAttribute ("name", "scheduleElements");    Element listTag = createList (doc);	fieldElem.appendChild (listTag);	if (!rs.isEmpty ()) {	  for (Iterator iter = rs.iterator (); iter.hasNext (); ) {		TimeSpan elem = (TimeSpan) iter.next ();		Element value = createValue (doc);		listTag.appendChild (value);		value.appendChild (createLittleInterval (doc, 												 new Date (elem.getStartTime ()),												 new Date (elem.getEndTime   ())));	  }	}		return fieldElem;  }