Hi!
2 years ago I wrote my Master Thesis regarding Google Earth and KML.
As a part of the thesis I made a Java framework for generating KML.
Now I have released the framework as open source at
http://code.google.com/p/kmlframework/
The current version is updated for KML 2.2 and allows you to easily
create KML documents to files or from a Servlet. The framework aims to
not only help you create the KML "manually", but also help you manage
several common tasks needed for dynamic KML services. The latter is
still being updated to match the new features of KML 2.2.
Please take a look at the link above and feel free to send me your
comments. I appreciate that!
Best regards,
Eivind Bøhn