That is the way that I've done it. Sorry, I did a poor job putting together my example. I've probably had more trouble with section names then anything else in eZ publish.. Sometimes I name a section and my application won't work, but if I remove the name it works! Is there a trick to using section names? Are the names variables that have to be initialized first using let or default?
The name parameter on sections is used to set a variable scope. Using sections to loop sets the variables $item, $index and $key in the current scope.
If you try to do what you you are doing with out the names then the outter section loop $item, $index and $key variables with be over written by the inner section loop variables.
If you are still haveing trouble with the template code turn on debugging. I'm sure the answers will be there :)