* @throws IOException on error
     * @throws DocumentException on error
     */
    public void setFields(XfdfReader xfdf) throws IOException, DocumentException {
        HashMap<String, String> fd = xfdf.getFields();
        for (String f: fd.keySet()) {
            String v = xfdf.getFieldValue(f);
            if (v != null)
                setField(f, v);
            List<String> l = xfdf.getListValues(f);
            if (l != null)
            	setListSelection(v, l.toArray(new String[l.size()]));
        }
    }