Reduce coupling between refdata and libxml2
Instead of directly manipulating the libxml2 XML tree in refdata.cpp,
make the reference data operations act on an internal data structure
(declared in refdata-impl.h). Move all libxml2 interaction into
separate refdata-xml.* files.
This has several advantages:
- The internal data structure more clearly communicates the organization
of the reference data, making the code easier to understand.
- The internal data structure can be extended to include information
that is not easily possible to store in the XML tree, such as state
information about what reference data items have been actually used in
the test.
- Coupling to libxml2 is reduced, and the operations in refdata-xml.cpp
are very standard XML manipulation commands (basically, just writing
out a tree of elements sequentially, or reading them in), making it
easier to make these use a common wrapper if such a wrapper is needed
in the future for other XML operations.
One behavior change affects the tests, where the old behavior was not
worth preserving: now checkString() and checkStringBlock() can check
against the same reference data, instead of giving very obscure
assertion failures if a mismatch occurred.
Change-Id: Ie067ba65eb4ccf017ab1950b3746a9abd30da2b6