if you are trying to iterate on all your controls in the xml and retreive the info, you should use xpath.

here is an example:

xpathdocument doc = new xpathdocument("yourfile.xml");
xpathnavigator navigator = doc.createnavigator();
xpathnodeiterator iterator ="/controls/*");
while (iterator.movenext())


using linq: (for forecolor/linkcolor check for null)

xdocument loaded = xdocument.load(@"c:\xmlfile1.xml");

            var q = from c in loaded.descendants().descendants()
                            select new
                                content = c.attribute("content"),
                                location = c.attribute("location"),
                                size = c.attribute("size"),
                                forecolor = c.attribute("forecolor"),
                                linkcolor = c.attribute("linkcolor")

            foreach (var controlitem in q)
                console.writeline("control content = {0}", controlitem.content);

Related Query

More Query from same tag