c++ implementation of XML parser