docs: @SuppressWarnings("unchecked")
      protected <T extends Result>T createStAXResult(
              Class<T> resultClass) throws SQLException {
  
          StAXResult       result       = null;
          OutputStream     outputStream = this.setBinaryStreamImpl();
          Constructor      ctor;
          XMLOutputFactory factory;
          XMLStreamWriter  xmlStreamWriter;
  
          try {
              factory         = XMLOutputFactory.newInstance();
              xmlStreamWriter = factory.createXMLStreamWriter(outputStream);
  
              if (resultClass == null) {
                  result = new StAXResult(xmlStreamWriter);
              } else {
                  ctor   = resultClass.getConstructor(XMLStreamWriter.class);
                  result = (StAXResult) ctor.newInstance(xmlStreamWriter);
              }
          } catch (SecurityException ex) {
              throw Exceptions.resultInstantiation(ex);
          } catch (IllegalArgumentException ex) {
              throw Exceptions.resultInstantiation(ex);
          } catch (IllegalAccessException ex) {
              throw Exceptions.resultInstantiation(ex);
          } catch (InvocationTargetException ex) {
              throw Exceptions.resultInstantiation(ex.getTargetException());
          } catch (FactoryConfigurationError ex) {
              throw Exceptions.resultInstantiation(ex);
          } catch (InstantiationException ex) {
              throw Exceptions.resultInstantiation(ex);
          } catch (NoSuchMethodException ex) {
              throw Exceptions.resultInstantiation(ex);
          } catch (XMLStreamException ex) {
              throw Exceptions.resultInstantiation(ex);
          }
  
          return (T) result;
      }