I have a text file "document.xml" that is an XML Document. Now I need the start and end position of an XmlElement in the related XML Document file. I want the start position and the length of the XmlElement's OuterXml within the plain text of the raw document.
Background: In my program i want to show an xml configuration file within an RichTextBox. For better navigation I visualize the Document Element structure in an additional TreeView Control. If the user select a note in the TreeView I want to highlight the XmlCode (OuterXml) of the selected XmlElement in the RichTextBox.
How can I do this?