使用到了tinyxml这个开源的类
CString strConfigFile = _T("XXX.xml"); tixmlDocument doc(strConfigFile); if (doc.LoadFile()) { tixmlElement* pRootNode = doc.RootElement(); tixmlElement* pBlkNode = NULL; if(pRootNode) pBlkNode = pRootNode->FirstChildElement(); // add items while (pBlkNode) { //Do sth with this node pBlkNode = pBlkNode->NextSiblingElement(); } }