If it's about extracting some text from XML and process it, see
http://support.microsoft.com/kb/317662[
^].
If you insist on using Regex to extract all text from the XML, see
Remove all the HTML tags and display a plain text only inside (in case XML is not well formed)[
^].
If you want to extract a specific portion of the XML data, you may try something like
string xml = ...;
var match = Regex.Match(xml, @"<MyElement.*?>([\s\S]*?)</MyElement>");
string result = match.Success ? match.Group[1].Value : null;
You still face the problem that the text may contain xml entities. These would need to be replaced by the respective plain characters. This needs a bit of creativity. I would then discard the regex solution and use xml dom approach, e.g. by employing
http://msdn.microsoft.com/en-us/library/system.xml.xmldocument.loadxml.aspx[
^] and accesing the inner text of a respective node.
Cheers
Andi