reading XML string and writing it to a SQL database



This is not a cross-post. I asked a similar question in another group but
got no meaningful response. I am working with the output of a digital
scale. I retrieve the data from the scale via telnet as a text string. The
data is formatted with XML tags to denote the data attributes and delimit
each record. Mutiple records are normally in a single stream. The records
are very simple consisting of only 6 or 8 fields.

Neither I nor the embedded programmer are very verse in XML which accounts
for why I am asking for assistance.
The structure of the string lies below.

<?xml version="1.0" standalone="yes" ?>
<DATAPACKET Version="2.0">
<METADATA>
<FIELDS>
<FIELD attrname="TXID" fieldtype="i2" />
<FIELD attrname="GroupID" fieldtype="i2" />
<FIELD attrname="ScaleID" fieldtype="i2" />
<FIELD attrname="Line" fieldtype="i2" />
<FIELD attrname="Station" fieldtype="i2" />
<FIELD attrname="Weight" fieldtype="fixed" DECIMALS="15"
WIDTH="18" />
<FIELD attrname="DateWeighed" fieldtype="dateTime" />
</FIELDS>
<PARAMS />
</METADATA>
<ROWDATA />
</DATAPACKET>


.