public function expandtemplates( $text, $title = null, $generatexml = false ) {
		$etArray = array(
			'action' => 'expandtemplates',
			'text'   => $text
		);

		if( $generatexml ) $etArray['generatexml'] = '';
		if( !is_null( $title ) ) $etArray['title'] = $title;

		Hooks::runHook( 'PreQueryExpandtemplates', array( &$etArray ) );

		pecho( "Parsing templates...\n\n", PECHO_NORMAL );

		$ret = $this->apiQuery( $etArray );
		return $ret['expandtemplates']['*'];

	}