Sorry, I'm not familiar with any application (apart of Firebug - we'll return to that in a moment) that will do that out of the box. If it's really big - you might have to roll out a custom solution - it shouldn't be too complicated to use some XML/HTML parser and traverse through nodes until you find your wanted text - at which point you'd use some built in function to get XPath of the current element.
About the mentioned Firefox plugin - Firebug. I don't have enough reputation to show you a picture - but it's simple enough process to do this:
open XML file in Firefox - it probably doesn't have style defined, so you'll see the familiar:
This XML file does not appear to have any style information associated
with it. The document tree is shown below.
press F12 to call Firebug, you should see that the file is now rendered a bot like html - with every element being inline and thus the text is "merged" to a blob. That's of no import - the important part is that in the Firebug's HTML tab you can see your XML file parsed.
- in Firebug's search input box type what you want to find, it'll be focused upon in the HTML tab.
- right-click on the wanted element in the HTML tab, and at the top you should see two options of some interest:
You can also try this with Firefox native Developer Tools:
- open XML file in Firefox and press F12 twice to call and hide Firebug - I haven't found a way to make the file load up "correctly", instead of the tree view - Firebug does that.
- open up Developer Tools (click "Open Menu" button -> Developer -> Toggle Tools)
- click on your (poorly) rendered XML file to focus on it, Ctrl+F to search a phrase, it'll be highlighted just like with any other search
- click on inspector tool ("Pick an element from the page") and click on the highlighted text
- right-click on the found element in the Inspector tab, and choose "Copy Unique Selector" - though in my Firefox it'll sometimes return "undefined" instead of the top node, even though the XML in question does validate...
For a test file:
<title>XML Developer's Guide</title>
<description>An in-depth look at creating applications
Where our searched phrase is "Computer", and thus out wanted node is:
The results are:
catalog book#bk101 genre
- Firefox Developer Tools "Copy Unique Selector"
#bk101 > genre:nth-child(3)
My only concern is that you wrote your file is large. If it's really, really large - well, you know how browsers like to act from time to time. ;)