diff --git xmlrpc_example/xmlrpc_example.info xmlrpc_example/xmlrpc_example.info
index f95e50b..5edc8ea 100644
--- xmlrpc_example/xmlrpc_example.info
+++ xmlrpc_example/xmlrpc_example.info
@@ -5,3 +5,4 @@ package = Example modules
 version = VERSION
 core = 7.x
 files[] = xmlrpc_example.module
+files[] = xmlrpc_example.test
diff --git xmlrpc_example/xmlrpc_example.module xmlrpc_example/xmlrpc_example.module
index 8f74d4e..201a44c 100644
--- xmlrpc_example/xmlrpc_example.module
+++ xmlrpc_example/xmlrpc_example.module
@@ -3,72 +3,179 @@
 
 /**
  * @file
- * This is an example of how to implement XML-RPC callbacks by implementing a
- * validation suite.
+ * This is an example of how to implement XML-RPC callbacks by registering
+ * an XMLRPC server function and then calling it with the xmlrpc() function.
  *
- * Information on the test in this suite can be found at:
- * http://www.xmlrpc.com/validator1Docs
+ * For experimentation you may be interested in the
+ * @link http://drupal.org/project/xmlrpctester XMLRPC Tester module @endlink.
+ *
+ * Note that the @link http://drupal.org/project/services Services module @endlink
+ * is probably the more common way to do XMLRPC at this time.
+ *
+ * @see hook_xmlrpc()
+ * @see xmlrpc()
+ * @see xmlrpc_errno()
+ * @see xmlrpc_error_msg()
  */
 
+// This is the server part of the module, implementing a silly
+// little xmlrpc server.
 /**
- * Implementation of hook_xmlrpc().
+ * Implements hook_xmlrpc().
  *
- * This function provides Drupal with an array to map XML-RPC callbacks to the
+ * Provides Drupal with an array to map XML-RPC callbacks to the
  * functions implemented by this module.
+ * @see hook_xmlrpc()
  */
 function xmlrpc_example_xmlrpc() {
-  return (array(
-    'validator1.arrayOfStructsTest' => 'xmlrpc_example_arrayOfStructsTest',
-    'validator1.countTheEntities' => 'xmlrpc_example_countTheEntities',
-    'validator1.easyStructTest' => 'xmlrpc_example_easyStructTest',
-    'validator1.echoStructTest' => 'xmlrpc_example_echoStructTest',
-    'validator1.manyTypesTest' => 'xmlrpc_example_manyTypesTest',
-    'validator1.moderateSizeArrayCheck' => 'xmlrpc_example_moderateSizeArrayCheck',
-    'validator1.nestedStructTest' => 'xmlrpc_example_nestedStructTest',
-    'validator1.simpleStructReturnTest' => 'xmlrpc_example_simpleStructReturnTest'
-  ));
-}
+   $methods[] =  array(
+      'xmlrpc_example.add',
+      '_xmlrpc_example_add',
+      array(
+        'int', // the type of the return value
+        'int', // the type of the first argument
+        'int',  // the type of the second argument
+      ),
+      t('Returns the sum of the two arguments.')
+  );
+  $methods[] =  array(
+      'xmlrpc_example.subtract',
+      '_xmlrpc_example_subtract',
+      array('int', 'int', 'int'),
+      t('Return difference of the two arguments.')
+  );
 
-function xmlrpc_example_arrayOfStructsTest($array) {
-  $sum = 0;
-  foreach ($array as $struct) {
-    $sum += $struct['curly'];
+  return $methods;
+}
+/**
+ * Sum the two arguments.
+ * @param $num1
+ * @param $num2
+ * @return
+ *   The sum of the arguments.
+ *
+ * @see xmlrpc_error()
+ */
+function _xmlrpc_example_add($num1, $num2) {
+  $sum = $num1 + $num2;
+  if ($sum <= 10) {
+    return $sum;
+  }
+  else {
+    return xmlrpc_error(10001, t("Sorry, I only have ten fingers and can't count past that."));
   }
-  return $sum;
 }
 
-function xmlrpc_example_countTheEntities($string) {
-  return array(
-    'ctLeftAngleBrackets' => substr_count($string, '<'),
-    'ctRightAngleBrackets' => substr_count($string, '>'),
-    'ctAmpersands' => substr_count($string, '&'),
-    'ctApostrophes' => substr_count($string, "'"),
-    'ctQuotes' => substr_count($string, '"'),
-    );
+/**
+ * Return the difference of the two arguments.
+ * @param numeric $num1
+ * @param numeric $num2
+ * @return
+ *   The difference of the two arguments.
+ *
+ * @see xmlrpc_error()
+ */
+function _xmlrpc_example_subtract($num1, $num2) {
+  $difference = $num1 - $num2;
+  if ($difference >= 0) {
+    return $difference;
+  }
+  else {
+    return xmlrpc_error(10002, t("I have not learned to do negative numbers yet."));
+  }
 }
 
-function xmlrpc_example_easyStructTest($array) {
-  return $array["curly"] + $array["moe"] + $array["larry"];
-}
 
-function xmlrpc_example_echoStructTest($array) {
-  return $array;
+// Now begins the client/UI portion of the module.
+/**
+ * Implements hook_menu for a simple explanation page.
+ */
+function xmlrpc_example_menu() {
+  $items['examples/xmlrpc_example'] = array(
+    'title' => 'XMLRPC example',
+    'description' => 'Demonstrates client and server side XMLRPC with Drupal',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('xmlrpc_example_demo_form'),
+    'access callback' => TRUE,
+  );
+  return $items;
 }
 
-function xmlrpc_example_manyTypesTest($args) {
-  $timestamp = mktime($args[4]->hour, $args[4]->minute, $args[4]->second, $args[4]->month, $args[4]->day, $args[4]->year);
-  return array($args[0], $args[1], $args[2], $args[3], xmlrpc_date($timestamp), xmlrpc_base64($args[5]));
+/**
+ * Present a form that uses xmlrpc to add or subtract.
+ */
+function xmlrpc_example_demo_form() {
+  $form = array();
+  $form['explanation'] = array(
+    '#markup' => "<div>" . t("The XMLRPC example demonstrates the use of the XMLRPC client and server in Drupal. <br/>It uses the xmlrpc() function to act as a client, calling itself as a server to demonstrate both sides of the operation.") . "</div>",
+  );
+  $form['num1'] = array(
+    '#type' => 'textfield',
+    '#title' => t("Enter an integer"),
+    '#default_value' => 2,
+    '#size' => 5,
+    '#required' => TRUE,
+  );
+  $form['num2'] = array(
+    '#type' => 'textfield',
+    '#title' => t("Enter a second integer"),
+    '#description' => t("An xmlrpc error will result if they sum to more than 10 or the difference is less than 0."),
+    '#default_value' => 2,
+    '#size' => 5,
+    '#required' => TRUE,
+  );
+  $form['add'] = array(
+    '#type' => 'submit',
+    '#value' => t("Add the integers"),
+    '#submit' => array('xmlrpc_example_add_submit'),
+  );
+  $form['subtract'] = array(
+    '#type' => 'submit',
+    '#value' => t("Subtract the integers"),
+    '#submit' => array('xmlrpc_example_subtract_submit'),
+  );
+  return $form;
 }
 
-function xmlrpc_example_moderateSizeArrayCheck($array) {
-  return array_shift($array) . array_pop($array);
-}
+/**
+ * Submit: Call the xmlrpc method to add and report the result.
+ * @param $form
+ * @param $form_state
+ *
+ * @see xmlrpc()
+ * @see xmlrpc_errno()
+ * @see xmlrpc_error_msg()
+ */
+function xmlrpc_example_add_submit($form, &$form_state) {
+  $server = url($GLOBALS['base_url'] . "/xmlrpc.php");
+  $result = xmlrpc($server, 'xmlrpc_example.add', (int)$form_state['values']['num1'], (int)$form_state['values']['num2']);
 
-function xmlrpc_example_nestedStructTest($array) {
-  return $array["2000"]["04"]["01"]["larry"] + $array["2000"]["04"]["01"]["moe"] + $array["2000"]["04"]["01"]["curly"];
+  if ($result === FALSE) {
+    drupal_set_message(t("Error return from xmlrpc(): Error: @errno, Message: @message", array('@errno' => xmlrpc_errno(), '@message' => xmlrpc_error_msg())));
+  }
+  else {
+    drupal_set_message(t("The XMLRPC server returned this response: @response", array('@response' => print_r($result, TRUE))));
+  }
 }
 
-function xmlrpc_example_simpleStructReturnTest($number) {
-  return array("times10" => ($number*10), "times100" => ($number*100), "times1000" => ($number*1000));
+/**
+ * Submit for subtraction: Call the xmlrpc method and report the result.
+ * @param $form
+ * @param $form_state
+ *
+ * @see xmlrpc()
+ * @see xmlrpc_errno()
+ * @see xmlrpc_error_msg()
+ */
+function xmlrpc_example_subtract_submit($form, &$form_state) {
+  $server = url($GLOBALS['base_url'] . "/xmlrpc.php");
+  $result = xmlrpc($server, 'xmlrpc_example.subtract', (int)$form_state['values']['num1'], (int)$form_state['values']['num2']);
+
+  if ($result === FALSE) {
+    drupal_set_message(t("Error return from xmlrpc(): Error: @errno, Message: @message", array('@errno' => xmlrpc_errno(), '@message' => xmlrpc_error_msg())));
+  }
+  else {
+    drupal_set_message(t("The XMLRPC server returned this response: @response", array('@response' => print_r($result, TRUE))));
+  }
 }
 
diff --git xmlrpc_example/xmlrpc_example.test xmlrpc_example/xmlrpc_example.test
new file mode 100644
index 0000000..8b50989
--- /dev/null
+++ xmlrpc_example/xmlrpc_example.test
@@ -0,0 +1,56 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Test case for the xmlrpc example module.
+ *
+ * This file contains the test cases to check if module is performing as
+ * expected.
+ *
+ */
+class XmlrpcExampleTestCase extends DrupalWebTestCase {
+  protected $xmlrpc_url;
+
+  public static function getInfo() {
+    return array(
+      'name' => 'XMLRPC example functionality',
+      'description' => 'Test xmlrpc service implementation.',
+      'group' => 'Examples',
+    );
+  }
+
+  /**
+   * Enable module.
+   */
+  function setUp() {
+    parent::setUp('xmlrpc_example');
+
+    // Init common variables.
+    global $base_url;
+    $this->xmlrpc_url = url($base_url . '/xmlrpc.php', array('external' => TRUE));
+  }
+
+  /**
+   * Perform several calls the xmlrpc inteface to test the services.
+   */
+  function testXmlrpcExampleBasic() {
+
+    // Unit test functionality.
+    $result = xmlrpc($this->xmlrpc_url, 'xmlrpc_example.add', 3, 4);
+    $this->assertEqual($result, 7, t('Successfully added 3+4 = 7'));
+    $result = xmlrpc($this->xmlrpc_url, 'xmlrpc_example.subtract', 4, 3);
+    $this->assertEqual($result, 1, t('Successfully subtracted 4-3 = 1'));
+
+    // Now test the UI.
+    $edit = array('num1' => 3, 'num2' => 5);
+    $this->drupalPost('examples/xmlrpc_example', $edit, t('Add the integers'));
+    $this->assertText(t("The XMLRPC server returned this response: @num", array('@num' => 8)));
+
+    $edit = array('num1' => 8, 'num2' => 3);
+    $this->drupalPost('examples/xmlrpc_example', $edit, t('Subtract the integers'));
+    $this->assertText(t("The XMLRPC server returned this response: @num", array('@num' => 5)));
+
+  }
+
+}
