Quote Originally Posted by qt_developer View Post
3.- I generate a XML with the new values. <-- How can I generate a new XML? I have a method with the XML hardcoded to generate the file. This is a problem if the XML changes or if the XML is very big.
What exactly is the problem?

If your XML file contains more information that the two strings, and you want to update those strings and leave the rest of the document unchanged, then use QDomDocument as others have already explained.

If you only care about those two strings and just want to write a new XML file with only those two strings (thus losing any existing additional content), then you can simply write it with QXmlStreamWriter. It improves over your current solution because it properly escapes the two strings.