                 throw new Error("Cannot resolve element definition for ref '" + ref + "'");
         }
 
-        // If the maximum occurence is 0 this element must not be present.
-        if (maxOccurs == 0)
-            return true;
-
         var elementName:String = definition.@name.toString();
         var elementQName:QName = schemaManager.getQNameForElement(elementName, getAttributeFromNode("form", definition));
 

            if (encodedElement != null)
                appendValue(siblings, encodedElement);

            // if required, but no value was encoded, the definition is not
            // satisfied
            if (isRequired  && encodedElement == null)

        var maxOccurs:uint = getMaxOccurs(definition);
        var minOccurs:uint = getMinOccurs(definition);

        // If the maximum occurence is 0 this element must not be present.
        if (maxOccurs == 0)
            return true;

        isRequired = isRequired && minOccurs > 0;

        // <element ref="..."> may be used to point to a top-level element definition
