how do I remove the spaces, carriage returns from in between < and >
**START BELOW THIS LINE*** admin
If this is valid XML you could use the SaveOptions.DisableFormatting enumeration:
string input = @" admin 123abc..@! this is an item "; string result = XElement.Parse(input).ToString(SaveOptions.DisableFormatting); Console.WriteLine(result);