Most programming languages provide an API that can be used to create XML documents.
in groovy the markup builder is used to create xml and html markup.