Assuming what moduleis a string, the problem is what you are comparing XAttributewith string.
Here's a fixed version of the request:
var value = (from l in localization.Elements("Localization").Elements("Module")
where (string) l.Attribute("id") == module &&
l.Element("Key").Value == key
select l.Element("Value").Value);
Note that I use XAttributefor the string, not for the property Value, so if the attribute iddoes not exist, it simply will not match, not explode.
, Single, First, SingleOrDefault FirstOrDefault , .