I would like to generate a file from an intermixed content of inline code snippets and contents of other files. Something like:

```
<target name="generate-js-function">
    <concat destfile="mycode.js">
        <header trimleading="yes">
            // begin auto generated
            var create = function() {
                function createHtmlSnippet1() {
        </header>

        <fileset file="snippet1.js"/>

        <header>
                }
        </header>

        <header trimleading="yes">
            // begin auto generated
            var create = function() {
                function createHtmlSnippet2() {
        </header>

        <fileset file="snippet2.js"/>

        <header>
                }
        </header>

                return '' + createHtmlSnippet1() + createHtmlSnippet2();

            }
            // end auto generated
        </header>
    </concat>
</target>

```

AFAIK, there can be only one `header` / `footer`, so what's the proper way to do it?

*Update*: if anything in the question isn't clear - please ask - I'll clarify happily.