Hi guys,

I have an xml document and I need copy part of the content to a new xml document, following an example:

Qt Code:
  1. <?xml encoding="utf-8" ?>
  2. <Library>
  3. <Location>
  4. <Test> <---- split here
  5. .....
  6. .....
  7. </Test>
  8. <Test2>
  9. .....
  10. .....
  11. </Test2>
  12. <Location>
  13. </Library>
To copy to clipboard, switch view to plain text mode 

I want to create a new document xml taking the "Test" tag as my root element. How can I do that? The next few snippets of code:

Qt Code:
  1. ...
  2. xml.setContent(b); // It's ok, its working.
  3. QDomElement root = xml.documentElement();
  4. QDomNode node = root.firstChild();
  5. ...
To copy to clipboard, switch view to plain text mode 

Thanks,

Marcelo E. Geyer