private static string EscapeXmlAttribute(Match m) { string value = m.Groups["Type"].Value; return String.Format("name=\"{0}\"", value.Replace("<", "<") .Replace(">", ">") ); }