Try to declare the list of Data and extendedData outside of the loop and to instanciate them in the loop.
Something like this:
String [] nextLine;
//extendedData
List<Data> list = null;
ExtendedData extendedData = null;
Document d = kml.createAndSetDocument().withName("FromCSVFile").withOpen(true);
Placemark p = null;
while ((nextLine = reader.readNext()) != null) {
list = new ArrayList<Data>();
extendedData = new ExtendedData();
p = new Placemark();
[...]
d.getFeature().add(p);
}
I do this with a db not a csv.
If this does not work send me the csv file.
Regards,
Benjamin