code: public static XAException createXAException(String key, Object args, int xaErrorCode) {
          XAException xaX = new XAException(
                          args == null ?
                                          getNLSMessage(key) :
                                          getNLSMessage(key, args));
  
          xaX.errorCode = xaErrorCode;
  
          return xaX;
      }
docs: Create an XAException with a translated error message and an XA error code.
  The XAException constructors provided by the XAException API allow only for either an
  error message or an XA error code to be specified. This method constructs an
  XAException with both. The error message is created from the NLS key and arguments.
  
  @param key the NLS key.
  @param args Object or Object[] listing parameters for the message; can be null if none.
  @param xaErrorCode the XA error code.
  
  @return a newly constructed XAException with the specified XA error code and a
  descriptive error message.