There is some information here:
http://viper-toolkit.sourceforge.net/docs/scripting/
But, as you know, it isn't always accurate. I'd recommend either
generating data in the old plain text format or using
viper.api.impl.XmlSerializer.toWriter(viperData, java.io.PrintWriter
(java.io.FileWriter('yourfile.xml')))
where viperData is a ViperData object. As far as I can remember, this
is how viper saves things internally.