New function dir2xml