Create a script file with the following contents. (Substitute the name of your original file for "test.txt")
cat test.txt | while read hostnm randstr
do echo \<name\>$hostnm\<\/name\>
The first line of above script tells it to use bash to do the rest of the script. It directs output of the command to the while loop which sets a variable for each item on each line it reads (in your case 2 items with first variable being called hostnm and second being called randstr). Note the variable names are arbitrary you could use billybob and ralph if you wanted.
The next line outputs the first item on each line calling the variable as $hostnm wraps the tagging you want.
The extra "" symbols you see are to escape the special meaning (< = redirect in normally, > = redirect standard output normally so you don't want to do that. The \< and \> says to use the symbols literally instead of using their special meanings.
The line after that does the same thing for the second item found on each input line.
This uses a "while loop" - it says to repeat for every line it finds. The "do" tells it what to do for every line and the "done" tells it to end the while loop.