public function toXml(\SimpleXmlElement $root) {
    	$methodNode = $root->addChild("method");
    	$methodNode->addAttribute("name", $this->getName());
    	$modifier = "";
    	if ($this->isPublic()) {
    		$modifier = "public";
    	} elseif ($this->isProtected()) {
    		$modifier = "protected";
    	} elseif ($this->isPrivate()) {
    		$modifier = "private";
    	}
    	$methodNode->addAttribute("modifier", $modifier);
    	$methodNode->addAttribute("static", $this->isStatic()?"true":"false");
    	$methodNode->addAttribute("abstract", $this->isAbstract()?"true":"false");
    	$methodNode->addAttribute("constructor", $this->isConstructor()?"true":"false");
    	$methodNode->addAttribute("final", $this->isFinal()?"true":"false");
    	$commentNode = $methodNode->addChild("comment");
    	
    	$node= dom_import_simplexml($commentNode);
   		$no = $node->ownerDocument;
   		$node->appendChild($no->createCDATASection($this->getDocComment())); 
    	
    	
    	foreach ($this->getParameters() as $parameter) {
    		$parameter->toXml($methodNode);
    	}
    }