Use XML Literals in C#?

XML literals are a feature of VB.NET, not C#. What you have posted is as close as you can get in C#. You may want to consider replacing the embedded double quotes with single quotes though (as both types are valid XML). For larger amounts of XML you may want to consider the answer from … Read more

Backslashes in single quoted strings vs. double quoted strings

Double-quoted strings support the full range of escape sequences, as shown below: \a Bell/alert (0x07) \b Backspace (0x08) \e Escape (0x1b) \f Formford (0x0c) \n Newline (0x0a) \r Return (0x0d) \s Space (0x20) \t Tab (0x09) \v Vertical tab (0x0b) For single-quoted strings, two consecutive backslashes are replaced by a single backslash, and a backslash … Read more