code: static void writeIoDevice(IoDevice ioDevice, BufferedWriter writer, int priority) throws
              IOException {
          writer.write(XML_START_TAG);
          XMLUtils.writeXmlAttribute(VENDOR_ID, ioDevice.getVendorId(), writer);
          XMLUtils.writeXmlAttribute(PRODUCT_ID, ioDevice.getProductId(), writer);
          XMLUtils.writeXmlAttribute(DEVICE_ID, ioDevice.getDeviceId(), writer);
  
          String name = ioDevice.getName();
          if (name != null) {
              XMLUtils.writeXmlAttribute(NAME, name, writer);
          }
  
          String vendorName = ioDevice.getVendorName();
          if (vendorName != null) {
              XMLUtils.writeXmlAttribute(VENDOR_NAME, vendorName, writer);
          }
  
          if (priority != INVALID_PRIORITY) {
              XMLUtils.writeXmlAttribute(PRIORITY, priority, writer);
          }
          writer.write(XMLUtils.ELEMENT_END);
      }
docs: TODO use XmlSerializer