diff --git django/contrib/gis/db/backends/spatialite/operations.py django/contrib/gis/db/backends/spatialite/operations.py
index 2ba54e5..58f5577 100644
--- django/contrib/gis/db/backends/spatialite/operations.py
+++ django/contrib/gis/db/backends/spatialite/operations.py
@@ -133,6 +133,18 @@ class SpatiaLiteOperations(DatabaseOperations, BaseSpatialOperations):
         gis_terms += self.geometry_functions.keys()
         self.gis_terms = dict([(term, None) for term in gis_terms])
 
+        if version >= (2, 4, 0):
+            # Spatialite 2.4.0-RC4 added AsGML and AsKML, however both
+            # RC2 (shipped in popular Debian/Ubuntu packages) and RC4
+            # report version as '2.4.0', so we fall back to feature detection
+            try:
+                self._get_spatialite_func("AsGML(GeomFromText('POINT(1 1)'))")
+                self.gml = 'AsGML'
+                self.kml = 'AsKML'
+            except DatabaseError:
+                # we are using < 2.4.0-RC4
+                pass
+
     def check_aggregate_support(self, aggregate):
         """
         Checks if the given aggregate name is supported (that is, if it's
diff --git django/contrib/gis/tests/geoapp/tests.py django/contrib/gis/tests/geoapp/tests.py
index b7ce3b7..b642bdd 100644
--- django/contrib/gis/tests/geoapp/tests.py
+++ django/contrib/gis/tests/geoapp/tests.py
@@ -1,10 +1,11 @@
 import re
 from django.db import connection
+from django.db.utils import DatabaseError
 from django.contrib.gis import gdal
 from django.contrib.gis.geos import (fromstr, GEOSGeometry,
     Point, LineString, LinearRing, Polygon, GeometryCollection)
 from django.contrib.gis.tests.utils import (
-    no_mysql, no_oracle, no_spatialite,
+    no_mysql, no_oracle, no_postgis, no_spatialite,
     mysql, oracle, postgis, spatialite)
 from django.test import TestCase
 
@@ -92,8 +93,8 @@ class GeoModelTest(TestCase):
 
     def test03a_kml(self):
         "Testing KML output from the database using GeoQuerySet.kml()."
-        # Only PostGIS supports KML serialization
-        if not postgis:
+        # Only PostGIS and Spatialite (>=2.4.0-RC4) support KML serialization
+        if not (postgis or (spatialite and connection.ops.kml)):
             self.assertRaises(NotImplementedError, State.objects.all().kml, field_name='poly')
             return
 
@@ -117,7 +118,7 @@ class GeoModelTest(TestCase):
 
     def test03b_gml(self):
         "Testing GML output from the database using GeoQuerySet.gml()."
-        if mysql or spatialite:
+        if mysql or (spatialite and not connection.ops.gml) :
             self.assertRaises(NotImplementedError, Country.objects.all().gml, field_name='mpoly')
             return
 
@@ -131,12 +132,15 @@ class GeoModelTest(TestCase):
         if oracle:
             # No precision parameter for Oracle :-/
             gml_regex = re.compile(r'^<gml:Point srsName="SDO:4326" xmlns:gml="http://www.opengis.net/gml"><gml:coordinates decimal="\." cs="," ts=" ">-104.60925\d+,38.25500\d+ </gml:coordinates></gml:Point>')
-            for ptown in [ptown1, ptown2]:
-                self.assertTrue(gml_regex.match(ptown.gml))
+        elif spatialite:
+            # Spatialite has extra colon in SrsName
+            gml_regex = re.compile(r'^<gml:Point SrsName="EPSG::4326"><gml:coordinates decimal="\." cs="," ts=" ">-104.609251\d+,38.255001</gml:coordinates></gml:Point>')
         else:
             gml_regex = re.compile(r'^<gml:Point srsName="EPSG:4326"><gml:coordinates>-104\.60925\d+,38\.255001</gml:coordinates></gml:Point>')
-            for ptown in [ptown1, ptown2]:
-                self.assertTrue(gml_regex.match(ptown.gml))
+
+        for ptown in [ptown1, ptown2]:
+            self.assertTrue(gml_regex.match(ptown.gml))
+
 
     def test03c_geojson(self):
         "Testing GeoJSON output from the database using GeoQuerySet.geojson()."
@@ -729,6 +733,26 @@ class GeoModelTest(TestCase):
         self.assertEqual(ref_hash, h1.geohash)
         self.assertEqual(ref_hash[:5], h2.geohash)
 
+    @no_mysql
+    @no_oracle
+    @no_postgis
+    def test30_spatialite_gml_and_kml(self):
+        # ensure kml and gml exist for spatialite >= 2.4.0-RC4
+        def supports_gml():
+            try:
+                connection.ops. _get_spatialite_func("AsGML(GeomFromText('POINT(1 1)'))")
+                return True
+            except DatabaseError:
+                return False
+
+        if connection.ops.spatial_version >= (2, 4, 0) and supports_gml():
+            self.assertTrue(connection.ops.gml)
+            self.assertTrue(connection.ops.kml)
+        else:
+            self.assertFalse(connection.ops.gml)
+            self.assertFalse(connection.ops.kml)
+
+
 from test_feeds import GeoFeedTest
 from test_regress import GeoRegressionTests
 from test_sitemaps import GeoSitemapTest
diff --git docs/ref/contrib/gis/db-api.txt docs/ref/contrib/gis/db-api.txt
index 9bd5ecc..a75a04e 100644
--- docs/ref/contrib/gis/db-api.txt
+++ docs/ref/contrib/gis/db-api.txt
@@ -287,9 +287,9 @@ Method                                PostGIS  Oracle  SpatiaLite
 :meth:`GeoQuerySet.force_rhr`         X
 :meth:`GeoQuerySet.geohash`           X
 :meth:`GeoQuerySet.geojson`           X
-:meth:`GeoQuerySet.gml`               X        X
+:meth:`GeoQuerySet.gml`               X        X       X
 :meth:`GeoQuerySet.intersection`      X        X       X
-:meth:`GeoQuerySet.kml`               X
+:meth:`GeoQuerySet.kml`               X                X
 :meth:`GeoQuerySet.length`            X        X       X
 :meth:`GeoQuerySet.make_line`         X
 :meth:`GeoQuerySet.mem_size`          X
