Eliminate the dependency on libxml2
libxml2 is the only remaining third-party library that Windows builds of
wimlib need. It's a bit of a pain to have to download it, build it, and
trick libtool into linking it into the resulting DLL. It then
constitutes a significant part of the size of the resulting DLL, even
with the minimal libxml2 configuration options being used.
In reality, WIM files only use a small subset of XML containing the most
commonly used XML features. Using a full-featured XML library (that
supports "features" like External Entities that we have to remember to
disable) is a bit dangerous and not actually necessary. 7-Zip's WIM
support, for example, just uses a very minimal home-brew XML processor.
Another issue is that the libxml2 API always uses UTF-8, which causes
the conversion UTF-16LE => UTF-8 => UTF-16LE to be needed on Windows.
This isn't really an "issue", per se, but it shouldn't be necessary.
Finally, wimlib was integrating with libxml2 at a low level via the tree
API, and it overlooked some things. For example, libxml2 trees have
separate CDATA and TEXT nodes, but wimlib was only looking at TEXT, so
CDATA was ignored. It was also possible for wimlib to create a document
containing control characters, which is not valid XML so it could not be
read. These weren't very important issues, but the point is, just using
an XML library doesn't solve quite as many problems as one would hope...
Therefore, just add a simple XML 1.0 processor directly in the source
code. It handles all XML features that are used in WIM files, plus a
bit more for futureproofing. It's also faster than libxml2.