We've got an API that associates from a class to an object of the class. It's not unlike some of the insides of CXF in this regard. It depends on generics.
T getAnnotation(Class<T> classOfAnnotation) We're trying to export this as a web service via CXF. Mediocre alternative #1: Use the @XmlElement annotation that specifies a choice for the XSD, and simply return a Set<Object> marked up as a set of the limited set of possible classes noted in the @XmlElement. This is not so hot, as the caller now has to crawl around in the Set or List or whatever to find the item of the desired class. We were hoping to cook up a way to express Map<String, Object>, and provide the class names as the keys. We can't figure out the @XmlElement magic that would support this, if any. Any JAX-WS experts out there with a clue, or the word that there is no hope?