Reorganized XML parsing for better DRY coding.
This should also make implementing TLS, SASL, Bind, and Extensions easier.