Do you mean like this: Html_write, DCG generators and backtracking - #2 by Boris
Or something completely different?