<tool id="collection_element_identifiers" name="Extract element identifiers" version="0.0.1">
    <description>of a list collection</description>
    <requirements>
    </requirements>
    <command detect_errors="exit_code"><![CDATA[
touch '$output'
#for $el in $input_collection:
    && echo '${el.element_identifier}' >> '$output'
#end for
    ]]>
    </command>
    <inputs>
        <param name="input_collection" type="data_collection" collection_type="list" label="Dataset collection"/>
    </inputs>
    <outputs>
        <data name="output" format="txt" />
    </outputs>
    <tests>
        <test>
            <param name="input_collection">
                <collection type="list">
                    <element name="e1" value="simple_line.txt" />
                    <element name="e2" value="simple_line.txt" />
                    <element name="e3" value="simple_line.txt" />
                </collection>
            </param>
            <output name="output" file="output.txt" />
        </test>
    </tests>
    <help><![CDATA[
This tool takes a list-type collection and produces a text dataset as output, containing the element identifiers of all datasets contained in the collection.
    ]]></help>
    <citations>
    </citations>
</tool>

<tool id="collection_element_identifiers" name="Extract element identifiers" version="0.0.1">
    <description>of a list collection</description>
    <requirements>
    </requirements>
    <command detect_errors="exit_code"><![CDATA[
mv '$cf' '$output'
    ]]>
    </command>
    <configfiles>
        <configfile name="cf">#for $el in $input_collection:
${el.element_identifier}
#end for</configfile>
    </configfiles>
    <inputs>
        <param name="input_collection" type="data_collection" collection_type="list" label="Dataset collection"/>
    </inputs>
    <outputs>
        <data name="output" format="txt" />
    </outputs>
    <tests>
        <test>
            <param name="input_collection">
                <collection type="list">
                    <element name="e1" value="simple_line.txt" />
                    <element name="e2" value="simple_line.txt" />
                    <element name="e3" value="simple_line.txt" />
                </collection>
            </param>
            <output name="output" file="output.txt" />
        </test>
    </tests>
    <help><![CDATA[
This tool takes a list-type collection and produces a text dataset as output, containing the element identifiers of all datasets contained in the collection.
    ]]></help>
    <citations>
    </citations>
</tool>

Use a configfile to prevent command-line injection
Use a configfile to prevent command-line injection

from element identifiers.

Thanks @jmchilton for the suggestion!
