code: public static void updateDisks(Document domainXml, List<StorageVol> volumes) throws LibvirtException {
          XPathFactory xpf = XPathFactory.instance();
          XPathExpression<Element> diskExpr = xpf.compile(XPATH_DISK, Filters.element());
          XPathExpression<Attribute> fileExpr = xpf.compile(XPATH_DISK_FILE, Filters.attribute());
          List<Element> disks = diskExpr.evaluate(domainXml);
          Iterator<StorageVol> cloneDiskIter = volumes.iterator();
          for (Element disk : disks) {
              Attribute file = fileExpr.evaluateFirst(disk);
              StorageVol cloneDisk = cloneDiskIter.next();
              file.setValue(cloneDisk.getPath());
          }
      }
docs: update the disks in the domain XML. It is assumed that the the size of the volumes is the same as the number of
  disk elements and that the order is the same.