attack; foreach ($xml->attack as $attack) { $attacks[] = (array) $attack; //print_r($attack); } $output = '<' . '?php // $Id$ /** * An XSS test case that provides some tools for testing XSS. */ class commonXSSTestCase Extends DrupalWebTestCase { function setUp() { parent::setUp(); $this->xss = array( '; foreach ($attacks as $attack) { $output .= " '" . addslashes($attack['code']) . "',"; } $output .= ' ); } } '; echo $output;