Initial XML parsing code