I had the same problem with wanting to pass xml messages between embedded devices.
I wrote the following (all in one header file) to be a fast api for parsing and generating xml. It doesn't support all of xml features, but most simple xml messages don't need them anyway:
http://www.scottlangham.co.uk/2009/01/rapidxml-a-quick-xml-parsergenerator-for-c/
There's example usage shown in the comments.
To write xml you can do something like the following:
int isbn = 2938237;
wstring authorName = "Isaac Asimov";
wstring borrower = "Mr. Blobby";
CWTag bookTag = libraryTag(L"Book")
(L"author",authorName) (L"isbn",isbn) (L"borrower",borrower);
bookTag(L"Review") (L"comments", L"very good");
and this results in the new xml being added under the tag:
<Book author="Isaac Asimov" isbn="2938237" borrower="Mr. Blobby">
<Review comments="very good"/>
</Book>
We did try another library, I can't remember which one, and found it wasn't quick enough. We didn't want to stick with manually formatting strings because we were dealing with quite a lot of messages.