static bool ReadBooleanAttribute (string attribute) { switch (attribute) { case null: case "true": return true; case "false": return false; default: throw new XmlException (); } }