string str = @"<?xml version=""1.0""?> <!-- comment at the root level --> <Root> <Child>Content</Child> </Root>"; XDocument doc = XDocument.Parse(str); Console.WriteLine(doc);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)