utils: XML handling improvement

* Fixes a problem with embedded XML inside text nodes.

* Creates a new file for tests for utils.py.

* Moves test_record_add_field to utils_tests.py.

Co-authored-by: Georgios Papoutsakis <georgios.papoutsakis@cern.ch>
Tested-by: Jan Aage Lavik <jan.age.lavik@cern.ch>