After a quick look at the TextPipe documentation it looks like it won't do anything like XPath expressions, but you should experiment with a Restrict to between tags
filter and a Remove All
subfilter.
Bear in mind that it is possible that TextPipe won't do what you want and you may have to look elsewhere for a solution.
How to delete a newline if it is the last character in a file?
How to pass command-line arguments to a Perl program?
How to efficiently calculate a running standard deviation
Howto use a variable in the replacement side of the Perl substitution operator?
How to summ quickly all numbers in a file?
How to remove duplicate items from an array in Perl?
How to differ of Two Arrays Using Perl