Variable into a KML file

Hi,
Im stuck, so i wondering if someone know how to do.

Im making a red line on google Earth.

I have an Arduino Mega and Ethernet card.

I calculate from a starting Point and known direction a new position that is the end of the red line.

And here my problem start.....

I want to update a KML file with a new end Point position....But i getting stuck.

Does anybody know how Arduino handle a KML file. And how Arduino can change parameters inside
a KML file??
The position inside the KLM file can look like 12.12345,56.68798.
But how to replace the positions inside the KLM file??

Does anybody know how Arduino handle a KML file.

Just like any other file. Its a stream of bytes on an SD card.

And how Arduino can change parameters inside
a KML file??

The same way you would if the file was a stream of bytes that are an XML file or a html file or a csv file.

But how to replace the positions inside the KLM file??

Read the bytes before the part to be changed, Do something with them. Do something with the bytes that represent the new position. Read and discard the bytes that represent the old position. Read and do something with the rest of the data in the file.