NAME

XML::Generator - Perl extension for generating XML

SYNOPSIS

  use XML::Generator;
  
  my $x = new XML::Generator;
  print $x->foo($x->bar({baz=>3}, $x->bam()),
		$x->bar([qux],"Hey there,\n", "world"));
  __END__
  # The above would yield:
  <foo><bar baz="3"><bam/></bar><qux:bar>Hey there,
world</qux:bar></foo>

DESCRIPTION

XML::Generator is an extremely simple module to help in the generation of XML. Basically, you create an XML::Generator object and then call a method for each tag, supplying the contents of that tag as parameters. You can use a hash ref as the first parameter if the tag should include atributes. If the tag should be part of a namespace, supply an array ref as the first argument with each level of the namespace an element in the array. If you want to specify a namespace as well as attributes, you can make the second argument a hash ref. If you do it the other way around, the array ref will simply get stringified and included as part of the content of the tag. The XML is returned as a string. A valid XML document must consist of a single tag at the top level, but this module does nothing to enforce that.

AUTHOR

Benjamin Holzman, bholzman@bender.com

SEE ALSO

Perl-XML FAQ

http://www.pobox.com/~eisen/xml/perl-xml-faq.html