docs: public void extract(@NotNull final String xmpString, @NotNull Metadata metadata, @Nullable Directory parentDirectory)
      {
          XmpDirectory directory = new XmpDirectory();
  
          if (parentDirectory != null)
              directory.setParent(parentDirectory);
  
          try {
              XMPMeta xmpMeta = XMPMetaFactory.parseFromString(xmpString);
              directory.setXMPMeta(xmpMeta);
          } catch (XMPException e) {
              directory.addError("Error processing XMP data: " + e.getMessage());
          }
  
          if (!directory.isEmpty())
              metadata.addDirectory(directory);
      }