in reply to find text in xml tag and replace another tag from data in same txt file

It might be simpler to use XML::LibXML for this. There's a tutorial here at: Stepping up from XML::Simple to XML::LibXML.
  • Comment on Re: find text in xml tag and replace another tag from data in same txt file