code: public static String xidToString(Xid xid) {
      return xid.getFormatId() + "_"
          + Base64.encodeBytes(xid.getGlobalTransactionId(), Base64.DONT_BREAK_LINES) + "_"
          + Base64.encodeBytes(xid.getBranchQualifier(), Base64.DONT_BREAK_LINES);
    }
docs: --- Routines for converting xid to string and back.