I just explained why.

If i called ObjectB::toXmlStream, wouldn't this be the output:
Qt Code:
  1. <ObjectA>
  2. <variable1>value of variable1</variable1>
  3. ...
  4. </ObjectA>
  5. <variable2>value of variable2</variable2>
To copy to clipboard, switch view to plain text mode 

As the super method is called first, it writes both it's opening and ending tag. But the inherited class needs to write elements in there too.