How to display data collected in a form on a page templated in module's tpl file? I'm new in the use of Drupal and I have some troubles with the module I'm writing.
This module generates a form that writes datas in some tables. It works fine, the datas are correctly writen in the database.

My module.module file contains the following functions :

function myform_xml_menu()

function myform_xml_form($form, &amp;$form_state)

function myform_xml_form_submit($form, &amp;$form_state)

The big question is : how to display the submitted datas ?

I've already tryed writing a second module called "Display" :

&lt;?php

function display_menu(){
$items['display'] = array(
    'title' =&gt; 'Display',
    'page callback' =&gt; 'display_contents',
    'access callback' =&gt; TRUE
);

return $items;
}

function display_contents(){

$query = db_select('form_xml', 'f');
$result = $query
        -&gt;fields('f')
        -&gt;execute()
        -&gt;fetchAll();

$output = '&lt;table&gt;&lt;th&gt;Id&lt;/th&gt;&lt;th&gt;Name&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;/tr&gt;';

foreach($result as $key){
    $output .= '&lt;tr&gt;';
    $output .= '&lt;td&gt;'.$key-&gt;id.'&lt;/td&gt;';
    $output .= '&lt;td&gt;'.$key-&gt;name.'&lt;/td&gt;';
    $output .= '&lt;td&gt;'.$key-&gt;description.'&lt;/td&gt;';
    $output .= '&lt;/tr&gt;';
} 
$output .= '&lt;/table&gt;';

return $output;
}


It adds a menu item and display my results correctly too. But I feel making it wrong or unproperly...
I've read many docs speaking about displaying module's results in blocks or pages.

How can I embed my results in a Drupal page in order to be able to manage its display using a .tpl file ?
You need to use hook_theme in your module to manage content in tpl file. 

Example,

Creating template file using the hook_theme function

    /**
    * Implements hook_theme
   */

    function example_theme(){
      return array(     
        'exampletheme' =&gt; array(
            'template' =&gt; 'exampletheme',
        'arguments' =&gt; array('example_array' =&gt; NULL),
          ),
      );
    }


Now, we can use "exampletheme" theme to display content. Below is the page callback function for the menu item.

 function example_callback(){

  $array = array(1,2,3); 

  return theme('exampletheme',  $array);
}


Now, you need to create "exampletheme.tpl.php" file and you can render the "example_array" in the tpl file.