code: public XAResourceWrapper createXAResourceWrapper(XAResource xares,
                                                      boolean pad, Boolean override, 
                                                      String productName, String productVersion,
                                                      String jndiName, boolean firstResource,
                                                      XAResourceStatistics xastat)
     {
        if (firstResource)
        {
           if (xastat != null && xastat.isEnabled())
           {
              return new FirstResourceXAResourceWrapperStatImpl(xares, pad, override, productName, productVersion,
                                                                jndiName, xastat);
           }
           else
           {
              return new FirstResourceXAResourceWrapperImpl(xares, pad, override, productName, productVersion, jndiName);
           }
        }
        else
        {
           if (xastat != null && xastat.isEnabled())
           {
              return new XAResourceWrapperStatImpl(xares, pad, override, productName, productVersion, jndiName, xastat);
           }
           else
           {
              return new XAResourceWrapperImpl(xares, pad, override, productName, productVersion, jndiName);
           }
        }
     }
docs: {@inheritDoc}