/** Initialize class
* @method __construct
* @param optional object obj
*/
function __construct($obj = NULL)
{
// create object
parent::XML_Serializer();
// add XML declaration
$this->setOption("addDecl", true);
// indent elements
$this->setOption("indent", " ");
// set name for root element
$this->setOption("rootName", "imdbXML");
$this->setOption("defaultTagName", "item");
$this->setOption("ignoreNull", "true");
// avoid replace entities
$this->setOption("replaceEntities", XML_SERIALIZER_ENTITIES_NONE);
// represent scalar values as attributes instead of element
//$this->setOption("scalarAsAttributes", true);
if ($obj) {
$this->parse($obj);
}
}