Remove Whitespace from XML in C#.NET
using System;
using System.Text.RegularExpressions;
public static class XMLUtility
{
public static string RemoveWhitespace( string xml )
{
Regex regex = new Regex(@”>\s*<");
return xml.Trim();
}
}