I am using the following code to search through a folder structure and write all package names and versions into a string.