str
is pointing to a string literal, so modifying it is illegal.
From the docs:
function xml_document::parse
[...] Passed string will be modified by the parser [...]
You could change the declaration to
char str[] = "<efa><departures>data</departures></efa>";