first why use CString unless you are manipulating the string value? this should work pAtt->setAttribute( pAttN->nodeName, pAttN->Gettext()); When you must have a BSTR variable prefer using _bstr_t rather than LPCSTR or CString _bstr_t sname = pAttN->nodeName; _bstr_t svalue = pAttN->Gettext(); pAtt->setAttribute(sname,svalue); Take a look at _bstr_t it has built in conversions to/from BSTRT-LPCTSTR I believe, I haven't worked with this stuff for a couple years now, but I think it's comprehensive, ctors that take either and conversion operators that get either so all you do is cast to the type you want.
led mike