code: public static Document toDocument(final String aFilePath, final String aPattern, final boolean aDeepConversion)
              throws FileNotFoundException, ParserConfigurationException {
          final Element element = toElement(aFilePath, aPattern, aDeepConversion);
          final Document document = element.getOwnerDocument();
  
          document.appendChild(element);
          return document;
      }
docs: Returns an XML Document 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 Document should match
  @param aDeepConversion Whether the conversion should descend through subdirectories
  @return An XML Document representation of the directory structure
  @throws FileNotFoundException If the supplied directory isn't found
  @throws ParserConfigurationException If the default XML parser for the JRE isn't configured correctly