private static XmlNode GetAndRemoveAttribute(XmlNode node, string attrib, bool fRequired) {
XmlNode a = node.Attributes.RemoveNamedItem(attrib);
// If the attribute is required and was not present, throw
if (fRequired && a == null) {
throw new ConfigurationErrorsException(
SR.GetString(SR.Config_missing_required_attribute, attrib, node.Name), node);
}
return a;
}