Thanks that did the trick sometimes I just can't see for looking. Interestingly the format of the out file is very different to the original file and in XML terms is probably the format I should adopt for the orginal file. Learning something new every day thats what its all about.