diff --git a/modules/extension/xsd/xsd-gml2/src/main/java/org/geotools/gml2/bindings/GMLEncodingUtils.java b/modules/extension/xsd/xsd-gml2/src/main/java/org/geotools/gml2/bindings/GMLEncodingUtils.java
index d6e3f05..fda33bb 100644
--- a/modules/extension/xsd/xsd-gml2/src/main/java/org/geotools/gml2/bindings/GMLEncodingUtils.java
+++ b/modules/extension/xsd/xsd-gml2/src/main/java/org/geotools/gml2/bindings/GMLEncodingUtils.java
@@ -123,6 +123,8 @@ public class GMLEncodingUtils {
             }
         }
 
+        
+
         if (type == null) {
             if (featureType instanceof SimpleFeatureType) {
                 // could not find the feature type in the schema, create a mock one
@@ -136,13 +138,24 @@ public class GMLEncodingUtils {
                         .getUserData().get(XSDElementDeclaration.class);
                 if (e != null) {
                     type = e.getTypeDefinition();
-                } else {
-                    throw new RuntimeException("Could not find type for " + qualifiedTypeName
-                            + " in schema");
+                } else if (element != null) {
+                    // as a last resort, use type definition from element declaration
+                    XSDTypeDefinition elementTypeDef = element.getTypeDefinition();
+                    QName qualifiedElementTypeName = new QName(
+                            elementTypeDef.getTargetNamespace(),
+                            elementTypeDef.getName());
+                    if (qualifiedTypeName.equals(qualifiedElementTypeName)) {
+                        type = elementTypeDef;
+                    }
                 }
             }
         }
 
+        if (type == null) {
+            throw new RuntimeException("Could not find type for " + qualifiedTypeName
+                    + " in schema");
+        }
+
         List particles = Schemas.getChildElementParticles(type, true);
         List properties = new ArrayList();
