Small bug fixes to XML Document & Element.