.getConverter(mEncodingSystem);
NodeList records = doc.getElementsByTagName(TAG_RECORD);
Node recordNode;
NamedNodeMap recordAttributes;
Attr recordLengthAttr;
int recordLength;
byte[] recordArray;
NodeList fields;
Node fieldNode;
NamedNodeMap fieldAttributes;
Attr fieldLengthAttr;
int fieldLength;
Node fieldTextNode;
String fieldValue;
byte[] fieldBytes;
int pos;
for (int i = 0; i < records.getLength(); i++)
{
recordNode = records.item(i);
recordAttributes = recordNode.getAttributes();
recordLengthAttr = (Attr) recordAttributes.getNamedItem(TAG_LENGTH);
recordLength = Integer.parseInt(recordLengthAttr.getNodeValue());
recordArray = new byte[recordLength];
pos = 0;
fields = recordNode.getChildNodes();
for (int k = 0; k < fields.getLength(); k++)
{
fieldNode = fields.item(k);
if (fieldNode.getNodeType() == Node.ELEMENT_NODE)
{
fieldAttributes = fieldNode.getAttributes();
fieldLengthAttr = (Attr) fieldAttributes
.getNamedItem(TAG_LENGTH);
fieldLength = Integer.parseInt(fieldLengthAttr
.getNodeValue());
fieldTextNode = fieldNode.getFirstChild();
fieldValue = fieldTextNode.getNodeValue();
fieldBytes = conv
.stringToByteArray(fieldValue, fieldLength);