Assuming xmlDoc is an XmlDocument object whats wrong with xmlDoc.OuterXml?
return xmlDoc.OuterXml;
The OuterXml property returns a string version of the xml.
More Related Contents:
- Can I escape a double quote in a verbatim string literal?
- Can I convert a C# string value to an escaped string literal?
- Unrecognized escape sequence for path string containing backslashes
- @(at) sign in file path/string [duplicate]
- How can I put quotes in a string?
- Finding quoted strings with escaped quotes in C# using a regular expression
- How can I Unescape and Reescape strings in .net?
- C# – What does “\0” equate to?
- Why does Read interfere with ReadLine? [duplicate]
- Easiest way to read from and write to files
- Easiest way to split a string on newlines in .NET?
- Converting string to title case
- Most efficient way to remove special characters from string
- Converting string to double in C#
- How can I get double quotes into a string literal?
- Replace Multiple String Elements in C#
- How to remove all white space from the beginning or end of a string?
- Find Nth occurrence of a character in a string
- Replacing a char at a given index in string? [duplicate]
- Escape text for HTML
- Casting vs Converting an object toString, when object really is a string
- Reversible shuffle algorithm using a key
- C# string replace
- Escape Quote in C# for javascript consumption
- Display Float as String with at Least 1 Decimal Place
- Delete last char of string
- Why is \ character being doubled in my @ string?
- How to sort list of Ip Addresses using c#
- Regular expression to find and remove duplicate words
- Int to string: cannot convert from ‘method group’ to ‘string’ [closed]