A good starting point are the Arduino tutorials
When choosing a data format consider the consumers of the data as the defining interface. I would avoid the XML for its size, and so choose JSON or CSV. CSV has the advantage that office calculation software like MS Excel can read it, and it is a bit more structured. But if your consumer has some JSON reader than it may be the best.