Set the preserveWhitespace flag to false:
XmlDocument doc = new XmlDocument();
doc.PreserveWhitespace = false;
doc.Load("foo.xml");
// doc.InnerXml contains no spaces or returns
More Related Contents:
- How to apply an XSLT Stylesheet in C#
- SelectSingleNode returns null when tag contains xmlNamespace
- How would you compare two XML Documents?
- Format a date in XML via XSLT
- Escape invalid XML characters in C#
- How to read attribute value from XmlNode in C#?
- How to create a XSD schema from a class?
- How to Select XML Nodes with XML Namespaces from an XmlDocument?
- How to serialize/deserialize simple classes to XML and back
- Fastest way to add new node to end of an xml?
- How to write a comment to an XML file when using the XmlSerializer?
- XML file creation using XDocument in C#
- Serialize an object to XElement and Deserialize it in memory
- Xml Comparison in C#
- How to pass XML from C# to a stored procedure in SQL Server 2008?
- How to Serialize List?
- Deserializing XML File with multiple element attributes – attributes are not deserializing
- Query Xml File for Records using Linq
- Create/delete element on XMLNode c#
- Query XDocument with xmlns attribute (namespace)
- How do I resolve entities when loading into an XDocument?
- Google Weather API 403 Error [duplicate]
- Returning auctions ending later than 10 days
- How to put attributes via XElement
- How can I convert a DataTable to an XML file in C#?
- Generate Digital Signature but with a Specific Namespace Prefix (“ds:”)
- Is there a way to make DataContractSerializer output cleaner XML?
- Traverse a XML using Recursive function
- How to return XML in ASP.NET?
- There is no Unicode byte order mark. Cannot switch to Unicode