First, your
xmlString
variable is malformed - you need closing tags for each element.
To resolve the multiple roots exception, do what
fes-sitecore said. I use a similar, yet alternative construct:
string xmlString = "<date>5/15/2018</date><name>test test</name><course>demo</course>";
XElement xml = XElement.Parse(string.Format("<root>{0}</root>",xmlString));
string date = xml.Element("date").Value;
string name = xml.Element("name").Value;
string course = xml.Element("course").Value;
EDIT =================================
You say that it doesn't work with "dynamic content", which you defined as "retrieved from the database". Either the data is stored as one giant XML string (BAD idea), or you're using the SQL Server
FOR XML AUTO,ELEMENTS
clause to retrieve the data.
If it's the first possibility (which is also probably the case), you have to process each row one at a time, and wrap the data from each row with an appropriate root element ("row" would be a good element name), and then the combine the rows into a single XML string, which is then wrapped with an appropriate root element.
If it's the 2nd possibility, simply wrap the returned XML string with a root element, and process its child elements, which should all have the same element name.
Either way, it would then be a simple matter to parse/deserialize your data into C# objects.