A method and apparatus for pleating or otherwise shaping a web are described herein. The method and apparatus may have numerous applications. In some embodiments, the method and apparatus are used in the formation, filling, and sealing of unit dose packages for consumer products. A method and apparatus for forming sealing two moving webs together, which webs have portions that are non-planar are also described herein.