@Override public DbData readData(InputStream in) throws XMLStreamException { XMLStreamReader sr = _staxInFactory.createXMLStreamReader(in); DbData result = new DbData(); sr.nextTag(); expectTag(FIELD_TABLE, sr); try { while (sr.nextTag() == XMLStreamReader.START_ELEMENT) { result.addRow(readRow(sr)); } } catch (IllegalArgumentException iae) { throw new XMLStreamException("Data problem: " + iae.getMessage(), sr.getLocation()); } sr.close(); return result; }