Doesn't work that way. You shouldn't write to the same file you're reading, you'll truncate it.
If your sed's work, then:
for FILE in *.xml
do
sed -re ':start s/<[^>]*>//g; /</ {N; b start}' "$FILE" > /tmp/$$
sed '/^$/d' < /tmp/$$ > "$FILE".new
done
rm -f /tmp/$$
Remove the '.new' once you've tested it and are sure it does what you want. It's all too easy to destroy your originals by accident when you edit them automatically.
Thank you! It works! The lines seems to be empty, but when I am trying to open them with vi, there is ^M character. Do you know how can I remove it?
Thanks a lot for your help.
Thank you very much for your helping. I tried and it works! Could you tell me please how the new file can be created in a other location. For example, I have the main dir, called DIR1 with subdirs called EX1, EX2, A1, A2 ....The xml files are located in subdirs. This dir is on C drive. I want to create a new dir named DIR1 with the same stucture and only the new files in F drive.