public void readXML(XMLStreamReader parser) throws IOException, XMLStreamException
   {
     parser.require(XMLStreamReader.START_ELEMENT, null, "matrix");

     m = Integer.parseInt(parser.getAttributeValue(null, "rows"));
     n = Integer.parseInt(parser.getAttributeValue(null, "cols"));

     A = new double[m][n];

     for (int i = 0; i < m; i++)
     {
       parser.nextTag();
       parser.require(XMLStreamReader.START_ELEMENT, null, "matrixrow");

       for (int j = 0; j < n; j++)
       {
         parser.nextTag();
         parser.require(XMLStreamReader.START_ELEMENT, null, "cn");

         if (!parser.getAttributeValue(null, "type").equals("IEEE-754"))
           throw new IOException("a xml stream exception occured");

         if (parser.next() != XMLStreamReader.CHARACTERS)
           throw new IOException("a xml stream exception occured");

         A[i][j] = getDecodedValue(parser.getText());

         parser.next();
         parser.require(XMLStreamReader.END_ELEMENT, null, "cn");
       }

       parser.next();
       parser.require(XMLStreamReader.END_ELEMENT, null, "matrixrow");
     }

     parser.next();
     parser.require(XMLStreamReader.END_ELEMENT, null,"matrix");
   }