modifying xml files using sed

Hello,

I have lots of xml files in the same format and I need to modify a xml tag in these files.
i loop over the files and apply sed to the files to make the modification but CPU goes to %100 while doing this. I think I'm doing something wrong. Here is my onliner:

for f in $( find . -name "*.xml" ); do sed -n "s/<idle>600<\/idle>/<idle>900<\/idle>/p" $f >> $f;   echo "file:" $f;done

by the way, I use Linux sed, not Unix sed.(I'm not sure if differs)

thanks in advance...

The problem is with this line. You cannot send the output of GNU sed to itself.

sed -n "s/<idle>600<\/idle>/<idle>900<\/idle>/p" $f >> $f

You could use the -i option to edit it in place. man sed for more information.