Index: trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/XmlGenerator.cs
===================================================================
--- trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/XmlGenerator.cs	(revision 12524)
+++ trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/XmlGenerator.cs	(revision 12638)
@@ -398,7 +398,7 @@
     /// <param name="obj">The object.</param>
     /// <param name="stream">The stream.</param>
-    /// <param name="useZip">If true, uses zip for compression, otherwise gzip.</param>
-    public static void Serialize(object obj, Stream stream, bool useZip = false) {
-      Serialize(obj, stream, ConfigurationService.Instance.GetConfiguration(new XmlFormat()), useZip);
+    /// <param name="compressionType">Type of compression, default is GZip.</param>
+    public static void Serialize(object obj, Stream stream, CompressionType compressionType = CompressionType.GZip) {
+      Serialize(obj, stream, ConfigurationService.Instance.GetConfiguration(new XmlFormat()), compressionType);
     }
 
@@ -410,7 +410,7 @@
     /// <param name="stream">The stream.</param>
     /// <param name="config">The configuration.</param>
-    /// <param name="useZip">If true, uses zip for compression, otherwise gzip.</param>
-    public static void Serialize(object obj, Stream stream, Configuration config, bool useZip = false) {
-      Serialize(obj, stream, config, false, useZip);
+    /// <param name="compressionType">Type of compression, default is GZip.</param>
+    public static void Serialize(object obj, Stream stream, Configuration config, CompressionType compressionType = CompressionType.GZip) {
+      Serialize(obj, stream, config, false, compressionType);
     }
 
@@ -422,9 +422,10 @@
     /// <param name="config">The configuration.</param>
     /// <param name="includeAssemblies">if set to <c>true</c> include need assemblies.</param>
-    /// <param name="useZip">If true, uses zip for compression, otherwise gzip.</param>
-    public static void Serialize(object obj, Stream stream, Configuration config, bool includeAssemblies, bool useZip = false) {
+    /// <param name="compressionType">Type of compression, default is GZip.</param>
+    public static void Serialize(object obj, Stream stream, Configuration config, bool includeAssemblies,
+                                 CompressionType compressionType = CompressionType.GZip) {
       try {
         Serializer serializer = new Serializer(obj, config);
-        if (useZip) {
+        if (compressionType == CompressionType.Zip) {
           Serialize(obj, stream, config, includeAssemblies, CompressionLevel.Optimal);
         } else {
@@ -448,9 +449,10 @@
     /// <param name="includeAssemblies">if set to <c>true</c> include need assemblies.</param>
     /// <param name="types">The list of all serialized types.</param>
-    /// <param name="useZip">If true, uses zip for compression, otherwise gzip.</param>
-    public static void Serialize(object obj, Stream stream, Configuration config, bool includeAssemblies, out IEnumerable<Type> types, bool useZip = false) {
+    /// <param name="compressionType">Type of compression, default is GZip.</param>
+    public static void Serialize(object obj, Stream stream, Configuration config, bool includeAssemblies, out IEnumerable<Type> types,
+                                 CompressionType compressionType = CompressionType.GZip) {
       try {
         Serializer serializer = new Serializer(obj, config);
-        if (useZip) {
+        if (compressionType == CompressionType.Zip) {
           Serialize(stream, includeAssemblies, CompressionLevel.Optimal, serializer);
         } else {
Index: trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/XmlParser.cs
===================================================================
--- trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/XmlParser.cs	(revision 12524)
+++ trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/XmlParser.cs	(revision 12638)
@@ -31,4 +31,11 @@
 
 namespace HeuristicLab.Persistence.Default.Xml {
+  /// <summary>
+  /// Type of compression used for the Xml stream or file.
+  /// </summary>
+  public enum CompressionType {
+    GZip,
+    Zip
+  }
 
   /// <summary>
@@ -216,36 +223,4 @@
     }
 
-
-    /// <summary>
-    /// Deserializes an object from the specified stream using GZip compression.
-    /// </summary>
-    /// <param name="stream">The stream.</param>
-    /// <returns>A fresh object instance.</returns>
-    private static object DeserializeWithGZip(Stream stream) {
-      try {
-        using (StreamReader reader = new StreamReader(new GZipStream(stream, CompressionMode.Decompress))) {
-          XmlParser parser = new XmlParser(reader);
-          Deserializer deserializer = new Deserializer(new TypeMapping[] { });
-          return deserializer.Deserialize(parser);
-        }
-      }
-      catch (PersistenceException) {
-        throw;
-      }
-      catch (Exception x) {
-        throw new PersistenceException("Unexpected exception during deserialization", x);
-      }
-    }
-
-    /// <summary>
-    /// Deserializes an object from the specified stream using Zip compression.
-    /// </summary>
-    /// <param name="stream">The stream.</param>
-    /// <returns>A fresh object instance.</returns>
-    private static object DeserializeWithZip(Stream stream) {
-      ZipArchive zipFile = new ZipArchive(stream);
-      return Deserialize(zipFile);
-    }
-
     /// <summary>
     /// Deserializes an object from the specified stream.
@@ -253,8 +228,8 @@
     /// <typeparam name="T">object type expected from the serialized stream</typeparam>
     /// <param name="stream">The stream.</param>
-    /// <param name="useZip">If true, uses zip for decompression, otherwise gzip.</param>
+    /// <param name="compressionType">Type of compression, default is GZip.</param>
     /// <returns>A fresh object instance.</returns>
-    public static T Deserialize<T>(Stream stream, bool useZip = false) {
-      return (T)Deserialize(stream, useZip);
+    public static T Deserialize<T>(Stream stream, CompressionType compressionType = CompressionType.GZip) {
+      return (T)Deserialize(stream, compressionType);
     }
 
@@ -263,11 +238,24 @@
     /// </summary>
     /// <param name="stream">The stream.</param>
-    /// <param name="useZip">If true, uses zip for decompression, otherwise gzip.</param>
+    /// <param name="compressionType">Type of compression, default is GZip.</param>
     /// <returns>A fresh object instance.</returns>
-    public static object Deserialize(Stream stream, bool useZip = false) {
-      if (useZip) {
-        return DeserializeWithZip(stream);
+    public static object Deserialize(Stream stream, CompressionType compressionType = CompressionType.GZip) {
+      if (compressionType == CompressionType.Zip) {
+        ZipArchive zipFile = new ZipArchive(stream);
+        return Deserialize(zipFile);
       } else {
-        return DeserializeWithGZip(stream);
+        try {
+          using (StreamReader reader = new StreamReader(new GZipStream(stream, CompressionMode.Decompress))) {
+            XmlParser parser = new XmlParser(reader);
+            Deserializer deserializer = new Deserializer(new TypeMapping[] { });
+            return deserializer.Deserialize(parser);
+          }
+        }
+        catch (PersistenceException) {
+          throw;
+        }
+        catch (Exception x) {
+          throw new PersistenceException("Unexpected exception during deserialization", x);
+        }
       }
     }
