I'm currently implementing a TCP API that works by sending commands as XML fragments over TCP (spec here: http://mirametrix.com/images/stories...e_API_V1.0.pdf )

When parsing commands, I could just process the strings myself, but that seems to defeat the purpose of XML. I'd rather take advantage of Qt's XML processing capabilities. Initially I was thinking I would create a QDomElement for each received command and then use its functions to get the command type and attributes. However I can't find a way to create a QDomElement from a string.

Is there an easy way to use Qt's XML classes when the data is just XML fragments instead of a complete document? QXmlStreamReader seems promising but I think it wants full documents, and it might be overkill for the purposes of reading single elements...