PEAR::XML_SVG package provides an object-oriented API for building SVG documents.