\n";}
else{ foreach (@level4){ print OUT $_;}} # no level4 if no existing item level metadata
} # end of if METS dir
} # end of old MD directory
if ($transcriptsExist){
print OUT "

Transcripts

\n";
}
# if, in the scans directory, there is a Transcriptions subdirectory,
# we need to consider these as items for storage.
undef @transdirs;
if (-e $oldTrans){
if (($newbie) || (!$transcriptsExist)){ print OUT "

\n";}
} # end if there's transcripts
foreach (@level5){ print OUT $_;} # no level5 if no existing transcripts
# if we find OCR, we need to do something similar: Text/OCR
# we need to find all scans directories, and there may be several, with various
# addendums such as Scans_check1, Scans_Online, RandomScans
print OUT "