<?php echo '<?xml version="1.0" encoding="utf-8"?>'?>
<userEmails>
	<msgList> 
<?php
//echo $this->messages->countMessages() . " messages found\n"; 
foreach($this->messages AS $messageNumber => $message) {
	if( $messageNumber < ($this->pageVolume * ($this->pageNumber - 1))+1 || $messageNumber > ($this->pageVolume * $this->pageNumber))
		continue; //skip messages that fall outside the desired range
	$headers = $message->getHeaders();
?>
		<msg id="<?php echo $headers['message-id'] ?>" epoch="<?php echo $headers['epoch'] ?>" date="<?php echo $headers['date'] ?>" priority="<?php echo $headers['priority'] ?>" size="<?php echo $headers['size'] ?>" sizeraw="<?php echo $headers['sizeraw'] ?>" msgicon="read" Attach="<?php echo $headers['hasattachments'] ?>" EmailCache="">
		        <subject><![CDATA[<?php echo $headers['subject'] ?>]]></subject>
		        <to><![CDATA[<?php echo $headers['to'] ?>]]></to>
				<from><![CDATA[<?php echo $headers['from'] ?>]]></from>
				<replyTo><![CDATA[<?php echo $headers['reply-to'] ?>]]></replyTo>
		</msg>
<?php } ?>
	</msgList>
	<timestamp><?php mktime() ?></timestamp>
	<msgNav total="<?php echo $this->messages->countMessages() ?>" view="25" start=""/>
	<folder><![CDATA[<?php echo $this->messages->getCurrentFolder() ?>]]></folder>
</userEmails>