FAQ » Getting started with the regular archives Use attr->tag ().c_str() and attr->textString ().c_str(). Also this article will be helpful.