using System;
using System.IO;
using System.Xml;
public class Sample {
public static void Main() {
string xmlData =
@"
C#
5.95
";
XmlTextReader reader = new XmlTextReader(new StringReader(xmlData));
if (reader.HasAttributes)
{
Console.WriteLine("Attributes of <" + reader.Name + ">");
for (int i = 0; i < reader.AttributeCount; i++)
{
reader.MoveToAttribute(i);
Console.Write(" {0}={1}", reader.Name, reader.Value);
}
reader.MoveToElement(); //Moves the reader back to the element node.
}
}
}