I need to build a java application that has tcp/ip communication and builds and xml file to send over that connection. Any thoughts on how to get started.

I have the project written in a VB ActiveX control, but I wanted something a bit more cross platform.

Is there something like a control or dll in JAVA that can be reused like that. I know about classes, but I am thinking more control over the source etc.