# man > CGI::XML

## NAME
    [CGI::XML](https://www.chedong.com/phpMan.php/perldoc/CGI%3A%3AXML/markdown) - Perl extension for converting CGI.pm variables to/from XML

## SYNOPSIS
      use [CGI::XML](https://www.chedong.com/phpMan.php/perldoc/CGI%3A%3AXML/markdown);
      $q = new [CGI::XML](https://www.chedong.com/phpMan.php/perldoc/CGI%3A%3AXML/markdown);

      # convert CGI.pm variables to XML
      $xml = $q->toXML;
      $xml = $q->toXML($root);

      # convert XML to CGI.pm variables
      $q->toCGI($xml);

## DESCRIPTION
    The [CGI::XML](https://www.chedong.com/phpMan.php/perldoc/CGI%3A%3AXML/markdown) module converts CGI.pm variables to XML and vice versa.

    [CGI::XML](https://www.chedong.com/phpMan.php/perldoc/CGI%3A%3AXML/markdown) is a subclass of CGI.pm, so it reads the CGI variables just as CGI.pm would.

## METHODS
    $q = new [CGI::XML](https://www.chedong.com/phpMan.php/perldoc/CGI%3A%3AXML/markdown)
        creates a new instance of [CGI::XML](https://www.chedong.com/phpMan.php/perldoc/CGI%3A%3AXML/markdown). You also have access to all of the methods in CGI.pm.

    $q->toXML([$root])
        where $root is an optional parameter that specifies the root element. By default, toXML will
        not return a root element.

    $q->toCGI($xml)
        where $xml is the XML you would like to convert to CGI.pm parameters. Values in the XML will
        overwrite any existing values if they exist.

## NOTE
    [CGI::XML](https://www.chedong.com/phpMan.php/perldoc/CGI%3A%3AXML/markdown) does not currently handle multiple selections passed from HTML forms. This will be
    added in a future release.

## AUTHOR
    Jonathan Eisenzopf <<eisen@pobox.com>>

## CONTRIBUTORS
    David Black <<dblack@candle.superlink.net>>

## SEE ALSO
### perl

