Hi,

I have two classes:

Qt Code:
  1. class A
  2. {
  3. public:
  4. int m_x;
  5. string m_s;
  6. };
  7.  
  8. class B
  9. {
  10. public:
  11. A m_a;
  12. };
To copy to clipboard, switch view to plain text mode 

Now I would like to create a XML structure, like this one:

Qt Code:
  1. <B>
  2. <A>
  3. <x>12</x>
  4. <y>55</y>
  5. </A>
  6. </B>
To copy to clipboard, switch view to plain text mode 

What is the best way to achieve this with Qt?

It would be necessary to read the XML and convert it to the object model later.