Read db options from config so that we can use mongodb driver's auto_reconnect feature if desired.
Escape text in text nodes and attributes so we don't get errors during xml to json conversion.