I have a string and its value is:
qwerty adsf The text of the samp
You'll have to use CDATA section. More specifically, create a XmlCDataSection using XmlDocument.CreateCDataSection and supply your string as a parameter.
XmlCDataSection
XmlDocument.CreateCDataSection