Small utility script for easily generating a DOM structure (returns either generated nodes or string representation)