I have a string and its value is:
qwerty
adsf
The text of the samp
I know you said C# but have you tried VB.NET for XML Literals. Amazing stuff.
Public Class Program
Public Shared Sub Main()
Dim myKeyBoardStyle = "dvorak"
Dim myXML As XElement =
qwerty
<%= myKeyBoardStyle.ToUpper() %>
adsf
The text of the sample element2
Console.WriteLine(myXML.ToString())
myXML.Save(".\fileFromXElement.xml")
End Sub
End Class
Notice the neat element which injects the result of code in into the output:
qwerty
DVORAK adsf The text of the sample element2
snip [removed opinions]