Let's breakdown the search process, then create the search function in C#
1.) What are we looking for?
2.) Where in the file do we THINK it might be? (top, bottom, left, right, upside down?)...etc
3.) search that location
4.) IF your desired substring isn't found then search the whole file, IF it is in fact FOUND, then get the text from inside of our XML tags.
I don't have the code for this but that might or might not help you out.
Anyways, here's some links you might try:
http://stackoverflow.com/questions/3092530/linq-how-to-search-data-from-large-xml-file[
^]
Large XML Files Processing and Indexing[
^]
Oh, and...
Try breaking the XML file into 2 parts, and search both subfiles at the same time and that might help on search time.
this link will help you split the xml file into smaller sub files.
Split large XML files into small files[
^]