Clean up program to construct xml requests by using an actual XML parser