code: protected static <T> JAXBElement createCollectionElement(String rootName, Collection<T> c) {
      JAXBCollection collection = new JAXBCollection(c);
      return new JAXBElement<>(new QName(rootName), JAXBCollection.class, collection);
    }
docs: Create a JAXBElement containing a JAXBCollection. Needed for marshalling a generic collection
  without a seperate wrapper class.
  
  @param rootName Name of the XML root element
  @return JAXBElement containing the given Collection, wrapped in a JAXBCollection.