/** * Converts the rules to properly formatted XML. * * @return XML formatted rule data */ public function toXML() { $doc = new GnipDOMDocument(); $ruleRoot = $doc->createElement('rule', $this->value); $doc->appendChild($ruleRoot); $attrName = $doc->createAttribute('type'); $ruleRoot->appendChild($attrName); $attrVal = $doc->createTextNode($this->type); $attrName->appendChild($attrVal); return trim($doc->asXML()); }