Hello,
There was a blog here is SDN that is similar to yours. What he did was this:
1. Create a data type (imported in message type) that has this structure
<Root>
<row>
<HEADER> (0..n)
<DETAIL> (0..n)
2. Once the mapping is done and the output is correct e.g
<Root>
<row>
<HEADER>
<DETAIL>
<DETAIL>
<row>
<HEADER>
<row>
<HEADER>
<DETAIL>
<DETAIL>
3. He removed the row using Java/XSLT
Hope this helps,
Mark