Datatable.WriteXml - How to preserve spaces in element names
问题 I've added functionality in my application where a DataTable is converted into XML , like so: dtResults.WriteXml(fileName); _x0020_ is being added instead of spaces within the outputted XML document. Is it possible to generate XML files without the _x0020_ code? i.e. can an XML file be generated using that method or similar, and actually have the spaces preserved? This is the DataGrid: This is the resulting XML: <Customers> <Customer_x0020_Name>Sean</Customer_x0020_Name> </Customers>