I have an XML file containing multiple tables which I need saving as separate files. I can use a parser to extract each table and printToFile but I need to insert a DOCTYPE declaration in each one because the receiving system requires one. Does anyone know how? I've tried various parser->methods without luck and even tried reading lines sequentially and writing them out with my insert in the correct place but the result doesn't appear to be XML. Any help gratefully received