Thanks a lot for your reply. However and after lots of investigations, here's the thing.
My code has no problem. It's a bug from Qt5.1 branch. QXmlQuery needs a QCoreApplication to work, that's why your code works fine. But when used with QApplication, evaluateTo fails.
If I try your code as-is, it works. If I change from QCoreApplication to QApplication, it fails.
I wrote a bug report on Qt's JIRA.