code: public static Element toElement(final String aFilePath, final String aPattern, final boolean aDeepTransformation)
              throws FileNotFoundException {
          final RegexFileFilter filter = new RegexFileFilter(aPattern);
          final File file = new File(aFilePath);
  
          if (file.exists() && file.canRead()) {
              return add(file, null, filter, aDeepTransformation);
          }
  
          throw new FileNotFoundException(aFilePath);
      }
docs: Returns an XML Element representing the file structure found at the supplied file system path. Files included
  in the representation will match the supplied regular expression pattern. This method doesn't descend through
  the directory structure.
  
  @param aFilePath The directory from which the structural representation should be built
  @param aPattern A regular expression pattern which files included in the Element should match
  @param aDeepTransformation Whether the conversion should descend through subdirectories
  @return An XML Element representation of the directory structure
  @throws FileNotFoundException If the supplied directory isn't found