Inserting CDATA Sections into XML Generated by DataSets

In version 1.0 of .NET, DataSets do not provide an internal MappingType that allows element data to be wrapped with a CDATA section when XML is generated.  This can present a problem when data pulled from the database contains reserved XML characters such as <. This demo shows how DataSet elements can be mapped to CDATA sections using a custom class named CDATAGenerator.

XML Generated by DataSet:

XML Mapped to CDATA Sections with CDATAGenerator Class: