This is a very simplified version of my problem. Suppose I have a text file containing several places the code 20091a or 20092a or 20093a. I'm wishing to surround all this code by the text <code></code>. So the resulting strings above would be like <code>20091a</code> or <code>20092a</code> or <code>20093a</code>.
So how do I replace the search text with text containing the search text? Is there any variable which holds the search text so that I could use something like :%s/2009.a/<code>$SEARCH_TEXT<\/div>?
viand parse the XML and then insert the text in a newly created node anywhere where you found it.