CSharp - Creating CData with XCData

Description

Creating CData with XCData

Demo

using System;
using System.Linq;
using System.Xml.Linq;
using System.Collections.Generic;

class Program/*ww w.j a  v  a2  s  .  co  m*/
{
    static void Main(string[] args){
          XElement xErrorMessage = new XElement("HTMLMessage",
                                     new XCData("<H1>Invalid user id or password.</H1>"));
    
          Console.WriteLine(xErrorMessage);
    }
}

Result