private static Dictionary <string, string> FilterFields(Stanza query, Dictionary <string, string> requestFields) { var filtered = new Dictionary <string, string>(); foreach (string field in requestFields.Keys) { foreach (var val in query.Elements()) { if (field.Equals(val.Name) && !val.Value.Equals(string.Empty)) { filtered[field] = val.Value; } if (!val.Name.Equals("remove")) { continue; } if (!filtered.ContainsKey("remove")) { filtered.Add("remove", "true"); } } } return(filtered); }