Data at the root level is invalid. Line 1, position 1.

Code Example - Data at the root level is invalid. Line 1, position 1.

                
                        string _byteOrderMarkUtf8 = Encoding.UTF8.GetString(Encoding.UTF8.GetPreamble());
if (xml.StartsWith(_byteOrderMarkUtf8))
{
    xml = xml.Remove(0, _byteOrderMarkUtf8.Length);
}