I am trying to get xml string from an attachment using IMAPX which later saves the data to byte[]. and after conversion, the string has linebreaks represented by \r\n.
byte[] att = w.FileData;
str = System.Text.Encoding.Default.GetString(att);
the string seems to have "\r\n" breaks instead of whitespace and new lines
str = str.Replace("\r\n", " ");
when I try to read this Xml using a string reader to read the Xml
StringReader sr = new StringReader("your xml");
DataSet ds = new DataSet();
ds.ReadXml(sr);
it doesn't seem that the program can understand the code in such format. I have tried to apply linebreaks in the Xml instead of \r\n like using 
 ; instead but without any success. the Xml works fine and converts to a datatable if it was retrieved from a file on the system but I want to be able to create the datatable from the string directly
original xml:
<?xml version="1.0" standalone="yes"?>
<Data>
<ID>931304</ID>
<Age>26</Age>
</Data>
<Data>
<ID>932160</ID>
<Age>26</Age>
</Data>
<Data />
it becomes like this on reading the byte[] att to a string
<?xml version="1.0" standalone="yes"?> \r\n <DocumentElement> \r\n <Data> \r\n <ID>931304</ID> \r\n <Age>26</Age> \r\n </Data> \r\n <Data> \r\n <ID>932160</ID> \r\n <Age>26</Age> \r\n </Data> \r\n <Data /> \r\n </DocumentElement>
the ds.ReadXml(sr);
does not recognize the \r\n, and even if it was replaced with a blank space.