POST to Vägverket API

how do I POST the XML?

That depends on the API used but if it's at least partly standards conforming the content type should be text/xml and not text/plain. It might also be necessary to tell the server what type of data you're able to process but that is not necessary for every API.