diff --git a/common.mk b/common.mk
index 7458e5f..3eeb193 100644
--- a/common.mk
+++ b/common.mk
@@ -7,4 +7,5 @@ SCANNER_ARGS = -v --add-include-path=$(top_builddir)/gir --add-include-path=.
 SCANNER = $(SCANNER_ENV) $(SCANNER_BIN) $(SCANNER_ARGS)
 SCANNER_LIBS = \
 	$(top_srcdir)/giscanner/*.py \
-	$(top_builddir)/giscanner/libgiscanner.la
+	$(top_builddir)/giscanner/libgiscanner.la \
+	$(top_builddir)/girepository/libgirepository.la
diff --git a/girepository/gdump.c b/girepository/gdump.c
index b26b0e8..a58e620 100644
--- a/girepository/gdump.c
+++ b/girepository/gdump.c
@@ -186,7 +186,12 @@ dump_interface_type (GType type, const char *symbol, GOutputStream *out)
   for (i = 0; i < n_interfaces; i++)
     {
       GType itype = interfaces[i];
-      escaped_printf (out, "    <extends>%s</extends>\n",
+      if (itype == G_TYPE_OBJECT)
+	{
+	  /* This is implicit */
+	  continue;
+	}
+      escaped_printf (out, "    <prerequisite name=\"%s\"/>\n",
 		      g_type_name (itype));
     }
   dump_properties (type, out);
diff --git a/girepository/girparser.c b/girepository/girparser.c
index 65ba282..a47bf1d 100644
--- a/girepository/girparser.c
+++ b/girepository/girparser.c
@@ -54,7 +54,7 @@ typedef enum
   STATE_INTERFACE_PROPERTY,   /* 15 */
   STATE_INTERFACE_FIELD,
   STATE_IMPLEMENTS, 
-  STATE_REQUIRES,
+  STATE_PREREQUISITE,
   STATE_BOXED,  
   STATE_BOXED_FIELD, /* 20 */
   STATE_STRUCT,   
@@ -2330,25 +2330,6 @@ start_element_handler (GMarkupParseContext *context,
 			    attribute_names, attribute_values,
 			    ctx, error))
 	goto out;
-      else if (strcmp (element_name, "class") == 0 &&
-	       ctx->state == STATE_REQUIRES)
-	{
-	  const gchar *name;
-
-	  name = find_attribute ("name", attribute_names, attribute_values);
-
-	  if (name == NULL)
-	    MISSING_ATTRIBUTE (context, error, element_name, "name");
-	  else
-	    {  
-	      GIrNodeInterface *iface;
-
-	      iface = (GIrNodeInterface *)ctx->current_node;
-	      iface ->prerequisites = g_list_append (iface->prerequisites, g_strdup (name));
-	    }
-
-	  goto out;
-	}
       break;
 
     case 'd':
@@ -2514,7 +2495,26 @@ start_element_handler (GMarkupParseContext *context,
 				attribute_names, attribute_values,
 				ctx, error))
 	goto out;
+      else if (strcmp (element_name, "prerequisite") == 0 &&
+	       ctx->state == STATE_INTERFACE)
+	{
+	  const gchar *name;
 
+	  name = find_attribute ("name", attribute_names, attribute_values);
+
+	  state_switch (ctx, STATE_PREREQUISITE);
+
+	  if (name == NULL)
+	    MISSING_ATTRIBUTE (context, error, element_name, "name");
+	  else
+	    {  
+	      GIrNodeInterface *iface;
+
+	      iface = (GIrNodeInterface *)ctx->current_node;
+	      iface ->prerequisites = g_list_append (iface->prerequisites, g_strdup (name));
+	    }
+	  goto out;
+	}
       break;
 
     case 'r':
@@ -2541,13 +2541,6 @@ start_element_handler (GMarkupParseContext *context,
 				   attribute_names, attribute_values,
 				   ctx, error))
 	goto out;      
-      else if (strcmp (element_name, "requires") == 0 &&
-	       ctx->state == STATE_INTERFACE)
-	{
-	  state_switch (ctx, STATE_REQUIRES);
-	  
-	  goto out;
-	}
       else if (start_struct (context, element_name,
 			     attribute_names, attribute_values,
 			     ctx, error))
@@ -2885,8 +2878,8 @@ end_element_handler (GMarkupParseContext *context,
       if (require_end_element (context, ctx, "implements", element_name, error))
         state_switch (ctx, STATE_CLASS);
       break;
-    case STATE_REQUIRES:
-      if (require_end_element (context, ctx, "requires", element_name, error))
+    case STATE_PREREQUISITE:
+      if (require_end_element (context, ctx, "prerequisite", element_name, error))
         state_switch (ctx, STATE_INTERFACE);
       break;
     case STATE_NAMESPACE_CONSTANT:
diff --git a/giscanner/ast.py b/giscanner/ast.py
index b4e8e9e..41587bc 100644
--- a/giscanner/ast.py
+++ b/giscanner/ast.py
@@ -385,6 +385,7 @@ class Interface(Node):
         self.methods = []
         self.properties = []
         self.fields = []
+        self.prerequisites = []
 
     def __repr__(self):
         return '%s(%r, %r)' % (
diff --git a/giscanner/girwriter.py b/giscanner/girwriter.py
index 030ea82..a5c50d9 100644
--- a/giscanner/girwriter.py
+++ b/giscanner/girwriter.py
@@ -254,6 +254,9 @@ class GIRWriter(XMLWriter):
             if isinstance(node, GLibObject):
                 for iface in node.interfaces:
                     self.write_tag('implements', [('name', iface)])
+            if isinstance(node, Interface):
+                for iface in node.prerequisites:
+                    self.write_tag('prerequisite', [('name', iface)])
             if isinstance(node, Class):
                 for method in node.constructors:
                     self._write_constructor(method)
diff --git a/giscanner/glibtransformer.py b/giscanner/glibtransformer.py
index 5f079ba..2edab36 100644
--- a/giscanner/glibtransformer.py
+++ b/giscanner/glibtransformer.py
@@ -575,6 +575,10 @@ class GLibTransformer(object):
             type_name, xmlnode.attrib['get-type'])
         self._introspect_properties(node, xmlnode)
         self._introspect_signals(node, xmlnode)
+        for child in xmlnode.findall('prerequisite'):
+            name = child.attrib['name']
+            prereq = self._resolve_gtypename(name)
+            node.prerequisites.append(prereq)
         # GtkFileChooserEmbed is an example of a private interface, we
         # just filter them out
         if xmlnode.attrib['get-type'].startswith('_'):
@@ -728,6 +732,9 @@ class GLibTransformer(object):
         self._resolve_methods(node.methods)
         self._resolve_properties(node.properties, node)
         self._resolve_signals(node.signals)
+        node.prerequisites = filter(None,
+            [self._force_resolve(x, allow_unknown=True)
+             for x in node.prerequisites])
 
     def _resolve_glib_object(self, node):
         node.parent = self._force_resolve(node.parent)
