With your xml loaded into the document.
var color = document.CreateNavigator().Evaluate("string(/skin/color/classname[. = '.depth']/following-sibling::colorcode[1])") as string;
This will return one of your color codes or an empty string.
As @Dolphin notes, using the following sibling means that I accept the same order of elements as in the original example.
My version of Linq looks a bit more verbose:
var classname = ".depth1";
var colorcode = "";
XElement doc = XElement.Parse(xml);
var code = from color in doc.Descendants("color")
where classname == (string) color.Element("classname")
select color.Element("colorcode");
if (code.Count() != 0) {
colorcode = code.First().Value;
}