Multiple layers/groups from a single KML file?

I am manually writing a KML file that contains multiple folders, each with a set of placemarks. When I import the KML file, all the placemarks from all the folders all get concatenated into a single group (i.e., layer) on MapHub. Is there a way to write the KML file so that the different folders are treated as separate layers?