* @param formatVersion the format version
* @throws IOException
*/
protected <T> void serializeCollection( @NotNull Iterable<? extends T> objects, @NotNull Class<T> type, @NotNull @NonNls String elementName, @NotNull SMOutputElement serializeTo, @NotNull Version formatVersion ) throws XMLStreamException, IOException {
AbstractXmlSerializer<? super T, SMOutputElement, XMLStreamReader, XMLStreamException> serializer = getSerializer( type );
Version resolvedVersion = getDelegatesMappings().resolveVersion( type, formatVersion );
for ( T object : objects ) {
SMOutputElement doorElement = serializeTo.addElement( serializeTo.getNamespace(), elementName );
serializer.serialize( doorElement, object, resolvedVersion );
}