Files passed to sed must be passed in the proper order.
Version 1 can be entered from the command line.
Version 2 can be made into an executable Unix shell script.
sed '/^end/,/^begin/d' file1 file2 ... fileX | uudecode # vers. 1 sed '/^end/,/^begin/d' "$@" | uudecode # vers. 2