The bqual is the branch qualifier, not the tx id - which is in the tid field.
When I start a transaction (obtained from JBossTM via theCosTransactionsgtrid_lengt::TransactionFactory create method) the "global transaction id" has length zero - ie the bqual_length field of an XID structure is zero.
Sorry I meant ie the gtrid_length field of an XID structure is zero
Where are you getting the XID structure from, that's not a CORBA OTS level construct. If you are creating and populating it from the otid_t then the otid_t.tid field should contain a value of non-zero length that you can use, although it may have a zero length bqual element. Look at XidImple or XATxConverter for how the JBossTS system creates Xids if you want some inspiration.