Text to XML conversion using script

Hi
I have a file in the format with so many records
DB2 Universal JDBC Driver Provider,wdialdcsq,New JDBC Datasource,jdbc/wdialdcsq,,dcsqdb2n,cldrdgw1.is.chrysler.com,2998,DB2,10,1,180,0,1800
i need to convert all these into
<DataSource name="wdialODDC" maxConnection="10" minConnection="0 " connectionTimeout="10" agedTimeout="0" unusedTimeout="160" databaseName = "addcdb2p" description = "" portNumber = "" connectionAttribute = "cursorhold=0" loginTimeout = "0" enableMultithreadedAccessDetection = "false" />

Parse input and use HERE template to make output.

out1()
{
echo $(<<EOF
<DataSource name="$a" maxConnection="$b" minConnection="$c " connectionTimeout="$d" agedTimeout="$e"
   unusedTimeout="$f" databaseName = "addcdb2p" description = ""
   portNumber = "$f" connectionAttribute = "cursorhold=0"
   loginTimeout = "0" enableMultithreadedAccessDetection = "false"
   now = "$(date '+%Y-%m-%d %H:%M:%S')"
/>
EOF
)
}


while IFS=,  read a b c d e f g h i j k l m n o p q r
do
        out1
done < filein > fileout