cleaning up parsexml code