Why not just use the doc() directive in the query itself?

Qt Code:
  1. QXmlQuery query;
  2. query.setQuery("doc(http://www.qtcentre.org/index.php)/html/body/whatever");
To copy to clipboard, switch view to plain text mode