Code:
using System.Xml.Linq;
//...
string countryName =
doc.Element("RootElement").Elements("Country")
.Where(
p => (string)p.Attribute == (someId)
).Select(
p => (string)p.Attribute("name")
).SingleOrDefault();
newClass = new CodeTypeDeclaration(countryName);
Note that the above requires you to know what you're looking for, otherwise you'll have to return an IEnumerable collection and iterate all values (which may be what you're looking for), the latter allows you to have an in memory representation of the xml document, allowing you to parse it with just c#