Code for various types of XML parsing