IT would be nice to create a reverse AJAX mechanism for long running tasks that need potentially dramatic server-push-type direction from the server...
The idea (I think) should essentially open a connection and expect that rather than just closing, the response might contain numerous DUML documents received over time... The server implementation is something quite different and while I am in favor of creating some sample implementation(s), this should not be the focus...
The script should probably copy stream into a buffer and keep looking for indexOf( '</duml>' ) to not be 0 (interval) and when that is the case, cut that piece from the buffer and process it...