Your "simplified view" would need to apply the C/C++ preprocessor, apply includes, and parse - at the very least. That's most of the front-end part of a compiler. It's really not a good idea to try writing something like that yourself. It is a good idea - if you want to do static analysis of code in a compiled language like C++ - to put yourself on top of an existing compiler or compiler framework.
Your go-to compiler framework is likely LLVM, on top of which the clang++ compiler is built. It's quite well-instrumented, I'm told, although I have not yet gotten to use it myself.
GCC may also be a possibility, albeit somewhat less popular.
Finally, if you have the abstract syntax tree in whatever representation LLVM or some other framework keeps it, I believe you would not want to convert it to XML, but rather do something with it as it is; but of course I may be wrong.