If an element is missing in the source XML, then the corresponding cell is erroneously omitted from the resulting CSV. This causes values in the resulting CSV to appear in the wrong columns.
This command:
xml2csv --input in.xml --output out.csv --tag "row"
On this input file, in.xml:
<?xml version="1.0"?>
<top>
<row>
<a>r1_col_a</a>
<b>r1_col_b</b>
</row>
<row>
<b>r2_col_b</b>
</row>
</top>
Produced this output file, out.csv:
a,b
"r1_col_a","r1_col_b"
"r2_col_b"
Notice that r2_col_b is in column a, when it should be in column b.