The empty enclosure element is both isStartElement() and isEndElement(). Your code will only process the start element portion of the logic before readNext() is called and the next element is fetched. You could look at the recursive descent approach in the QXmlStreamReader example.