protected <T> void serializeCollection( @Nonnull Iterable<? extends T> objects, @Nonnull Class<T> type, @Nonnull String elementName, @Nonnull SMOutputElement serializeTo, @Nonnull 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 );
}
}