Mapping a dom tree to a table and back.

I have a table view which displays parts of a DOM tree. Now to display I travel the tree and put the text to display into a grid, which is then displayed using a QAbstractTableModel. I want to make the table editable: After editing the table I need to find the DOM element which corresponds to the cell edited and update its content. I wonder what is the way to do this. Do QObjects, QDomNodes or QDomElements have some kind of unique identifier which I could use to keep track to them? Shall I use a pointer to the QDOMNodes or just store the position where in the QDomNodeLists they are?