protected List<EdmAnnotation<?>> getAnnotations(StartElement2 element) {
   // extract Annotation attributes
   try {
     Enumerable<Attribute2> atts = element.getAttributes();
     List<EdmAnnotation<?>> annots = new ArrayList<EdmAnnotation<?>>();
     for (Attribute2 att : atts) {
       QName2 q = att.getName();
       if (isExtensionNamespace(q.getNamespaceUri())) {
         // a user extension
         annots.add(
             EdmAnnotation.attribute(
                 q.getNamespaceUri(), q.getPrefix(), q.getLocalPart(), att.getValue()));
       }
     }
     return annots;
   } catch (Exception ex) {
     // not all of the xml parsing implementations implement getAttributes() yet.
     return null;
   }
 }