docs: @SuppressWarnings("unchecked")
      protected <T extends Source>T createStAXSource(
              Class<T> sourceClass) throws SQLException {
  
          StAXSource      source      = null;
          Constructor     sourceCtor  = null;
          Reader          reader      = null;
          XMLInputFactory factory     = null;
          XMLEventReader  eventReader = null;
  
          try {
              factory = XMLInputFactory.newInstance();
          } catch (FactoryConfigurationError ex) {
              throw Exceptions.sourceInstantiation(ex);
          }
  
          try {
              sourceCtor =
                  (sourceClass == null)
                  ? StAXSource.class.getConstructor(XMLEventReader.class)
                  : sourceClass.getConstructor(XMLEventReader.class);
          } catch (SecurityException ex) {
              throw Exceptions.sourceInstantiation(ex);
          } catch (NoSuchMethodException ex) {
              throw Exceptions.sourceInstantiation(ex);
          }
          reader = getCharacterStreamImpl();
  
          try {
              eventReader = factory.createXMLEventReader(reader);
          } catch (XMLStreamException ex) {
              throw Exceptions.sourceInstantiation(ex);
          }
  
          try {
              source = (StAXSource) sourceCtor.newInstance(eventReader);
          } catch (SecurityException ex) {
              throw Exceptions.sourceInstantiation(ex);
          } catch (IllegalArgumentException ex) {
              throw Exceptions.sourceInstantiation(ex);
          } catch (IllegalAccessException ex) {
              throw Exceptions.sourceInstantiation(ex);
          } catch (InstantiationException ex) {
              throw Exceptions.sourceInstantiation(ex);
          } catch (InvocationTargetException ex) {
              throw Exceptions.sourceInstantiation(ex.getTargetException());
          } catch (ClassCastException ex) {
              throw Exceptions.sourceInstantiation(ex);
          }
  
          return (T) source;
      }