Folder Specification
Each feature that is written to the KML writer can also use the kml_parent format attribute to identify the <Folder> element that should contain the feature. The value of the kml_parent format attribute should be the same as the ID of the Folder.
The KML reader will also add kml_parent attributes as necessary. Note: If kml_parent is not specified, it is assumed that the container for a given feature is the <Document> element.
The kml_document and kml_parent format attributes are designed to be used in conjunction with each other.
For example, to add a Placemark feature to the folder "A" in document other.kml, the feature needs to have the following attribute values:
kml_document="other.kml" and kml_parent="A"