TRQ-2197. Convert some libxml2 calls so that they don't use functions only in newer versions of libxml2. Also fix one other thing that Centos5 complained about.