#!/bin/sh
echo '?xml version="1.0"?>'
echo '<opencv_storage><images>' 
ls $1
echo '</images></opencv_storage>'
echo

#!/bin/sh
echo '<?xml version="1.0"?>'
echo '<opencv_storage><images>' 
find $1 -type f -print
echo '</images></opencv_storage>'
echo

Use find instead of ls to generate XML
Use find instead of ls to generate XML
