Not really that big of a change, but I'd go with an XPath solution. It locates all of the "magic strings" into one spot.
var nodes = from element in XElement.Load("Books.xml").XPathSelectElements("/Books/Book/Subject")
select new
{
Value = element.Value.Trim()
};
foreach (var n in nodes)
{
listBox1.Items.Add(n);
}
Since I've begun my profession as a software developer, I've learned one important fact - change is inevitable. Requirements change, code changes, and life changes.
So..If you're not moving forward, you're moving backwards.