docs: @SuppressWarnings("unchecked")
      protected <T extends Result>T createSAXResult(
              Class<T> resultClass) throws SQLException {
  
          SAXResult result = null;
  
          try {
              result = (resultClass == null) ? new SAXResult()
                      : (SAXResult) resultClass.newInstance();
          } catch (SecurityException ex) {
              throw Exceptions.resultInstantiation(ex);
          } catch (InstantiationException ex) {
              throw Exceptions.resultInstantiation(ex);
          } catch (IllegalAccessException ex) {
              throw Exceptions.resultInstantiation(ex);
          } catch (ClassCastException ex) {
              throw Exceptions.resultInstantiation(ex);
          }
  
          StAXResult          staxResult = createStAXResult(null);
          XMLStreamWriter     xmlWriter  = staxResult.getXMLStreamWriter();
          SAX2XMLStreamWriter handler    = new SAX2XMLStreamWriter(xmlWriter);
  
          result.setHandler(handler);
  
          return (T) result;
      }