added addtional xml handling
several formatting fixes