perl -pe "do{s/(\.+?)\|(.+?)\|(.*?)(?=\<\/value\>)/$1\<\/value\>\$2\<\/name\>\$3/gi;} while /\|/;"