You can query TaxCode and TaxRate ref to get details and use the corresponding Ids in time of Invoice creation.
ApiExplorer - https://developer.intuit.com/apiexplorer?apiname=V3QBO#TaxCode
To get a correct XML structure of an Invoice object with TaxCode and TaxRate, you can create an invoice from QBO UI(with tax) and retrieve the same using API.
Thanks