QDomDocument can read from IODEVICE. But problem that QTcpSocket is stream device, so he should read all data (many readready signals), and after that he create QDomDocument