TCP is at the TRANSPORT layer, layer 4. HTTP is at the APPLICATION layer, layer 7.
The 7 Layers of the OSI Model
In the OSI model, the upper layers (5-7) and the lower layers (1-4) have specific roles. Often times, the upper layers are combined in to 1 layer, and therefore the OSI model becomes a 5 layer TCP model. The lower layers provide the network connectivity and reliability. The upper layer(s) provide application services to users and programs. Everything you see or touch, as an application or developer, is somewhere in the upper layers.
What you are calling "sockets programming" is really no different than what any application does that needs to communicate on a network. A socket can't be opened unless an upper layer application requests it to happen. It is requesting that the operating system create a particular network socket, and send or receive data. Therefore, even a basic application that you create to send or receive data over a socket is considered an upper layer process.
It's debatable if your XML application operates at Layer 5, 6 or 7 because it really depends on what you do with the data from there. The request to open a socket technically happens at Layer 5 (Then the socket is opened and maintained in the lower layers). But, depending on what data you send or receive, and what you do with that data, you will begin operating at Layer 6 or 7. Because of this ambiguity, it's much easier to combine the upper layers in to a single layer, because it really makes little difference from an application point of view.