private XmlNode tryGetNodeByName(XmlNodeList nodes, string name) { foreach (XmlNode node in nodes) if (node.Name == name) return node; return null; }