Hi Caroline,
once you have an XML file called myXml, you should get it on a java.io.InputStream(this part you can find how to deal with googling, easily).
I don't know how is your XML formatted, so I'll consider you have a list of Points like <point>0.1,0.1</point>.
So iterate through your points list, and... follow
Kml kml = KmlFactory.createKml();
Document document = (Document) kml.getFeature();
List<Feature> featureList = document.getFeature();
Placemark placemark = KmlFactory.createPlacemark();
Point point = placemark.createAndSetPoint();
point.getCoordinates().add(KmlFactory.createCoordinate(myXml.X, myXml.Y));
featureList.add(placemark);
I hope I'm helping you