code: @Nullable
    public JAXBContext getFromCache (@Nonnull final Class <?> aClass, @Nullable final ClassLoader aClassLoader)
    {
      ValueEnforcer.notNull (aClass, "Class");
  
      final Package aPackage = aClass.getPackage ();
      if (aPackage.getAnnotation (XmlSchema.class) != null)
      {
        // Redirect to cached version
        return getFromCache (aPackage, aClassLoader);
      }
  
      // E.g. an internal class - try anyway!
      if (GlobalDebug.isDebugMode ())
        LOGGER.info ("Creating JAXB context for class " + aClass.getName ());
  
      if (aClassLoader != null)
        LOGGER.warn ("Package " +
                     aPackage.getName () +
                     " does not seem to be JAXB generated. Therefore a new JAXBContext is created and the provided ClassLoader is ignored!");
  
      try
      {
        // Using the version with a ClassLoader would require an
        // ObjectFactory.class or an jaxb.index file in the same package!
        return JAXBContext.newInstance (aClass);
      }
      catch (final JAXBException ex)
      {
        final String sMsg = "Failed to create JAXB context for class '" + aClass.getName () + "'";
        LOGGER.error (sMsg + ": " + ex.getMessage ());
        throw new IllegalArgumentException (sMsg, ex);
      }
    }
docs: Get the {@link JAXBContext} from an existing {@link Class} object. If the
  class's owning package is a valid JAXB package, this method redirects to
  {@link #getFromCache(Package)} otherwise a new JAXB context is created and
  NOT cached.
  
  @param aClass
  The class for which the JAXB context is to be created. May not be
  <code>null</code>.
  @param aClassLoader
  Class loader to use. May be <code>null</code> in which case the
  default class loader is used.
  @return May be <code>null</code>.