code: public static List<Disk> getDisks(Connect connect, Document domainXml) {
          try {
              List<Disk> ret = new ArrayList<>();
              XPathFactory xpf = XPathFactory.instance();
              XPathExpression<Element> diskExpr = xpf.compile(XPATH_DISK, Filters.element());
              XPathExpression<Attribute> typeExpr = xpf.compile(XPATH_DISK_TYPE, Filters.attribute());
              XPathExpression<Attribute> fileExpr = xpf.compile(XPATH_DISK_FILE, Filters.attribute());
              XPathExpression<Attribute> devExpr = xpf.compile(XPATH_DISK_DEV, Filters.attribute());
              List<Element> disks = diskExpr.evaluate(domainXml);
              for (Element disk : disks) {
                  Attribute type = typeExpr.evaluateFirst(disk);
                  Attribute file = fileExpr.evaluateFirst(disk);
                  Attribute dev = devExpr.evaluateFirst(disk);
  
                  StorageVol volume = LibvirtUtil.findVolume(connect, file.getValue());
  
                  ret.add(new Disk(dev.getValue(), file.getValue(), volume, type.getValue()));
              }
              return ret;
          } catch (LibvirtException e) {
              throw new LibvirtRuntimeException(e);
          }
      }
docs: Get the disks connected to the domain.