Several requests came in for more info on the mattress stitch and sewing a box cushion/pillow. Here are my lame explanations. I am sure there are better ones online, somewhere.
Here is a quick diagram of what this stitch looks like as you sew it. It is done from the right side, with the seam allowances neatly tucked under, and the pillow all stuffed. The gap is the part that you are closing with the mattress stitch. Using sturdy thread, stick the needle into the edge of the seam allowance and bringing it back up a short distance from where you entered, keeping the thread under the fabric, of course, then stick the needle directly across into the opposite side. It looks like a ladder, no? After a few ladders, pull on the thread and it will close the gap flatly. Practice makes perfect. WE knitters use this to make seams in knits.
Here is a side view of a box cushion. It includes welting in this case, but the construction is basically the same with or without welting. Two sides, exactly the same size, and a strip long enough to fit all around the shape, is the idea.
Sew one side and clip the corners as you reach them, and then before sewing the second half of the boxing, match the corners and clip those as well . Then line up the boxing to the corners assuring there will be no twisting. This assumes that the two sides are exactly the same size and the seam allowances of the seams are the same also. I don't usually quilt the boxing, just interface it with fusible interfacing, for stiffness.
Here it is on the pillow.
And this shows the invisible stitches closing the welted seam.
The strip is left slightly unsewn at the beginning so that it can meet its end, stitching the seam last and then using the invisible mattress stitch to close the gap.
It is easier to do it than to just look at these directions. Really.