http://www.perlmonks.org?node_id=787793


in reply to A data structure for XML generation

Also note XML::Ximple data representations. An example from the source code:
$ximple_tree = { tag_name => "unicycle" attrib => { color => "chrom", height => 3, brand => "foo"} content => ["The content of a ximple tree\n", "is heterogenious just like xml", "itself. For example this is how\n", "i would make the word", { tag_name=>"bold", attrib=>{}, content=>["cheese"] }, "appear in a bold tag"] };