using System;
using System.Xml.Linq;
class Program
{
static void Main() {
XElement ex = new XElement("Data");
XAttribute attrib = new XAttribute("CSharp", "12345");
Console.WriteLine(attrib);
int i = (int)attrib;
Console.WriteLine(i);
string s = (string)attrib;
Console.WriteLine(s);
ex.Add(attrib);
Console.WriteLine(ex);
Console.WriteLine(ex.Attribute("CSharp")?.Value);
}
}
/*
run:
CSharp="12345"
12345
12345
<Data CSharp="12345" />
12345
*/