Ahhh I see now.

It basically has an example of exactly what I want in the QXmlQuery::bindVariable() documentation.

Thanks