TiXmlElement * book = new TiXmlElement( "book" );
root->LinkEndChild( book );
string str1="name";
const string str2=catalog[i].id();
book->SetAttribute(str1,str2);
i get errors like [Error] no matching function for call to 'TiXmlElement::SetAttribute(std::string&, const string&)'
i need to set the attribute anyhow.
Did you forget to #define TIXML_USE_STL
?