docs: public void write() throws IOException {
          OutputStream outStream = null;
          XMLStreamWriter out = null;
          try {
              outStream = new FileOutputStream(jobFile);
              out = XMLOutputFactory.newInstance().createXMLStreamWriter(outStream, "UTF-8");
              out.writeStartDocument();
              out.writeStartElement(ELEMENT_JOB);
              for (final Map.Entry<String, Object> e: prop.entrySet()) {
                  out.writeStartElement(ELEMENT_PROPERTY);
                  out.writeAttribute(ATTRIBUTE_NAME, e.getKey());
                  if (e.getValue() instanceof String) {
                      out.writeStartElement(ELEMENT_STRING);
                      out.writeCharacters(e.getValue().toString());
                      out.writeEndElement(); //string
                  } else if (e.getValue() instanceof Set) {
                      out.writeStartElement(ELEMENT_SET);
                      final Set<?> s = (Set<?>) e.getValue();
                      for (final Object o: s) {
                          out.writeStartElement(ELEMENT_STRING);
                          out.writeCharacters(o.toString());
                          out.writeEndElement(); //string
                      }
                      out.writeEndElement(); //set
                  } else if (e.getValue() instanceof Map) {
                      out.writeStartElement(ELEMENT_MAP);
                      final Map<?, ?> s = (Map<?, ?>) e.getValue();
                      for (final Map.Entry<?, ?> o: s.entrySet()) {
                          out.writeStartElement(ELEMENT_ENTRY);
                          out.writeAttribute(ATTRIBUTE_KEY, o.getKey().toString());
                          out.writeStartElement(ELEMENT_STRING);
                          out.writeCharacters(o.getValue().toString());
                          out.writeEndElement(); //string
                          out.writeEndElement(); //entry
                      }
                      out.writeEndElement(); //string
                  } else {
                      out.writeStartElement(e.getValue().getClass().getName());
                      out.writeCharacters(e.getValue().toString());
                      out.writeEndElement(); //string
                  }
                  out.writeEndElement(); //property
              }
              out.writeStartElement(ELEMENT_FILES);
              for (final FileInfo i: files.values()) {
                  out.writeStartElement(ELEMENT_FILE);
                  if (i.src != null) {
                      out.writeAttribute(ATTRIBUTE_SRC, i.src.toString());
                  }
                  out.writeAttribute(ATTRIBUTE_URI, i.uri.toString());
                  out.writeAttribute(ATTRIBUTE_PATH, i.file.getPath());
                  if (i.result != null) {
                      out.writeAttribute(ATTRIBUTE_RESULT, i.result.toString());
                  }
                  if (i.format != null) {
                      out.writeAttribute(ATTRIBUTE_FORMAT, i.format);
                  }
                  try {
                      for (Map.Entry<String, Field> e: attrToFieldMap.entrySet()) {
                          final boolean v = e.getValue().getBoolean(i);
                          if (v) {
                              out.writeAttribute(e.getKey(), Boolean.TRUE.toString());
                          }
                      }
                  } catch (final IllegalAccessException ex) {
                      throw new RuntimeException(ex);
                  }
                  out.writeEndElement(); //file
              }
              out.writeEndElement(); //files
              out.writeEndElement(); //job
              out.writeEndDocument();
          } catch (final IOException e) {
              throw new IOException("Failed to write file: " + e.getMessage());
          } catch (final XMLStreamException e) {
              throw new IOException("Failed to serialize job file: " + e.getMessage());
          } finally {
              if (out != null) {
                  try {
                      out.close();
                  } catch (final XMLStreamException e) {
                      throw new IOException("Failed to close file: " + e.getMessage());
                  }
              }
              if (outStream != null) {
                  try {
                      outStream.close();
                  } catch (final IOException e) {
                      throw new IOException("Failed to close file: " + e.getMessage());
                  }
              }
          }
          lastModified = jobFile.lastModified();
      }