Index: apps/app_db.c
===================================================================
--- apps/app_db.c	(revision 148806)
+++ apps/app_db.c	(working copy)
@@ -39,23 +39,43 @@
 #include "asterisk/astdb.h"
 #include "asterisk/lock.h"
 
+/*** DOCUMENTATION
+	<application name="DBdel" language="en_US">
+		<synopsis>
+			Delete Key from Asterisk Database.
+		</synopsis>
+		<syntax argsep="/">
+			<parameter name="family" required="true" />
+			<parameter name="key" required="true" />
+		</syntax>
+		<description>
+			<para>This application will delete a key from the Asterisk database.</para>
+			<warning>
+				<para>This application has been DEPRECATED in favor of the DB_DELETE function.</para>
+			</warning>	
+		</description>
+		<see-also>
+			<ref type="function">DB_DELETE</ref>
+		</see-also>
+	</application>
+	<application name="DBdeltree" language="en_US">
+		<synopsis>
+			Delete family or keytree from Asterisk Database.
+		</synopsis>
+		<syntax argsep="/">
+			<parameter name="family" required="true" />
+			<parameter name="keytree" />
+		</syntax>
+		<description>
+			<para>This application will delete a family or keytree from the Asterisk database.</para>
+		</description>
+	</application>
+ ***/
 /*! \todo XXX Remove this application after 1.4 is relased */
-static char *d_descrip =
-"  DBdel(family/key): This application will delete a key from the Asterisk\n"
-"database.\n"
-"  This application has been DEPRECATED in favor of the DB_DELETE function.\n";
 
-static char *dt_descrip =
-"  DBdeltree(family[/keytree]): This application will delete a family or keytree\n"
-"from the Asterisk database\n";
-
 static char *d_app = "DBdel";
 static char *dt_app = "DBdeltree";
 
-static char *d_synopsis = "Delete a key from the database";
-static char *dt_synopsis = "Delete a family or keytree from the database";
-
-
 static int deltree_exec(struct ast_channel *chan, void *data)
 {
 	char *argv, *family, *keytree;
@@ -130,8 +150,8 @@
 {
 	int retval;
 
-	retval = ast_register_application(d_app, del_exec, d_synopsis, d_descrip);
-	retval |= ast_register_application(dt_app, deltree_exec, dt_synopsis, dt_descrip);
+	retval = ast_register_application_xml(d_app, del_exec);
+	retval |= ast_register_application_xml(dt_app, deltree_exec);
 
 	return retval;
 }
Index: apps/app_ivrdemo.c
===================================================================
--- apps/app_ivrdemo.c	(revision 148806)
+++ apps/app_ivrdemo.c	(working copy)
@@ -40,11 +40,20 @@
 #include "asterisk/lock.h"
 #include "asterisk/app.h"
 
-static char *tdesc = "IVR Demo Application";
+/*** DOCUMENTATION
+	<application name="IVRDemo" language="en_US">
+		<synopsis>
+			IVR Demo Application.
+		</synopsis>
+		<description>
+			<para>
+			Skeleton application that shows you the basic structure to create 
+			your own asterisk applications and demonstrates the IVR demo.</para>
+		</description>
+	</application>
+ ***/
+			
 static char *app = "IVRDemo";
-static char *synopsis = 
-"  This is a skeleton application that shows you the basic structure to create your\n"
-"own asterisk applications and demonstrates the IVR demo.\n";
 
 static int ivr_demo_func(struct ast_channel *chan, void *data)
 {
@@ -109,7 +118,7 @@
 
 static int load_module(void)
 {
-	return ast_register_application(app, skel_exec, tdesc, synopsis);
+	return ast_register_application_xml(app, skel_exec);
 }
 
 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "IVR Demo Application");
Index: apps/app_macro.c
===================================================================
--- apps/app_macro.c	(revision 148806)
+++ apps/app_macro.c	(working copy)
@@ -42,62 +42,110 @@
 /* special result value used to force macro exit */
 #define MACRO_EXIT_RESULT 1024
 
-static char *descrip =
-"  Macro(macroname,arg1,arg2...): Executes a macro using the context\n"
-"'macro-<macroname>', jumping to the 's' extension of that context and\n"
-"executing each step, then returning when the steps end. \n"
-"The calling extension, context, and priority are stored in ${MACRO_EXTEN}, \n"
-"${MACRO_CONTEXT} and ${MACRO_PRIORITY} respectively.  Arguments become\n"
-"${ARG1}, ${ARG2}, etc in the macro context.\n"
-"If you Goto out of the Macro context, the Macro will terminate and control\n"
-"will be returned at the location of the Goto.\n"
-"If ${MACRO_OFFSET} is set at termination, Macro will attempt to continue\n"
-"at priority MACRO_OFFSET + N + 1 if such a step exists, and N + 1 otherwise.\n"
-"Extensions: While a macro is being executed, it becomes the current context.\n"
-"            This means that if a hangup occurs, for instance, that the macro\n"
-"            will be searched for an 'h' extension, NOT the context from which\n"
-"            the macro was called. So, make sure to define all appropriate\n"
-"            extensions in your macro! (Note: AEL does not use macros)\n"
-"WARNING: Because of the way Macro is implemented (it executes the priorities\n"
-"         contained within it via sub-engine), and a fixed per-thread\n"
-"         memory stack allowance, macros are limited to 7 levels\n"
-"         of nesting (macro calling macro calling macro, etc.); It\n"
-"         may be possible that stack-intensive applications in deeply nested macros\n"
-"         could cause asterisk to crash earlier than this limit. It is advised that\n"
-"         if you need to deeply nest macro calls, that you use the Gosub application\n"
-"         (now allows arguments like a Macro) with explict Return() calls instead.\n";
+/*** DOCUMENTATION
+	<application name="Macro" language="en_US">
+		<synopsis>
+			Macro Implementation
+		</synopsis>
+		<syntax>
+			<parameter name="macroname" required="true" />
+			<parameter name="arg" multiple="true">
+				<argument name="arg1" />
+				<argument name="arg2" />
+			</parameter>
+		</syntax>
+		<description>
+		<para>Executes a macro using the context 'macro-<replaceable>macroname</replaceable>', 
+		jumping to the 's' extension of that context and executing each step, then returning 
+		when the steps end.</para>
+		<para>The calling extension, context, and priority are stored in 
+		<variable>MACRO_EXTEN</variable>, <variable>MACRO_CONTEXT</variable> and 
+		<variable>MACRO_PRIORITY</variable> respectively.  Arguments become 
+		<variable>ARG1</variable>, <variable>ARG2</variable>, etc in the macro context.</para>
+		<para>If you Goto out of the Macro context, the Macro will terminate and control 
+		will be returned at the location of the Goto. If <variable>MACRO_OFFSET</variable> 
+		is set at termination, Macro will attempt to continue at priority MACRO_OFFSET 
+		+ N + 1 if such a step exists, and N + 1 otherwise.</para>
+		<para>Extensions: While a macro is being executed, it becomes the current context.
+		This means that if a hangup occurs, for instance, that the macro will be searched 
+		for an 'h' extension, NOT the context from which the macro was called. So, make 
+		sure to define all appropriate extensions in your macro! </para>
+		<note><para>AEL does not use macros</para></note>
+		<warning><para>Because of the way Macro is implemented (it executes the 
+		priorities contained within it via sub-engine), and a fixed per-thread 
+		memory stack allowance, macros are limited to 7 levels of nesting 
+		(macro calling macro calling macro, etc.); It may be possible that 
+		stack-intensive applications in deeply nested macros could cause 
+		asterisk to crash earlier than this limit. It is advised that if you 
+		need to deeply nest macro calls, that you use the <literal>Gosub()</literal>
+		(now allows arguments like a Macro) with explict <literal>Return()</literal> calls instead.
+	   </para></warning>
+		</description>
+	</application>
+	<application name="MacroIf" language="en_US">
+		<synopsis>
+			Conditional Macro Implementation
+		</synopsis>
+		<syntax argsep="?">
+			<parameter name="expression" required="true" />
+			<parameter name="retvalue" argsep=":" required="true">
+				<argument name="macro_a"> 
+					<variablelist>
+						<variable name="arg1" />
+						<variable name="argN" />
+					</variablelist>
+				</argument>
+				<argument name="macro_b"> 
+					<variablelist>
+						<variable name="arg1" />
+						<variable name="argN" />
+					</variablelist>
+				</argument>
+			</parameter>
+		</syntax>
+		<description>
+		<para>Executes macro defined in <replaceable>macroname_a</replaceable> if 
+		<literal>expr</literal> is true (otherwise <literal>macroname_b</literal> 
+		if provided). Arguments and return values as in application Macro()</para>
+		</description>
+	</application>
+	<application name="MacroExit" language="en_US">
+		<synopsis>
+			Exit from Macro
+		</synopsis>
+		<description>
+		<para>Causes the currently running macro to exit as if it had ended normally 
+		by running out of priorities to execute. If used outside a macro, will 
+		likely cause unexpected behavior.</para>
+		</description>
+	</application>
+	<application name="MacroExclusive" language="en_US">
+		<synopsis>
+			Run Macro exclusively.
+		</synopsis>
+		<syntax>
+			<parameter name="macro" required="true" />
+			<parameter name="args" multiple="true" required="true">
+				<argument name="arg1" />
+				<argument name="argN" />
+			</parameter>
+		</syntax>
+		<description>
+		<para>Executes macro defined in the context <literal>macro-macroname</literal>
+		Only one call at a time may run the macro. (we'll wait if another call is 
+		busy executing in the Macro) Arguments and return values as in application 
+		<literal>Macro()</literal></para>
+		</description>
+	</application>
+			
+ ***/
 
-static char *if_descrip =
-"  MacroIf(<expr>?macroname_a[,arg1][:macroname_b[,arg1]])\n"
-"Executes macro defined in <macroname_a> if <expr> is true\n"
-"(otherwise <macroname_b> if provided)\n"
-"Arguments and return values as in application Macro()\n";
-
-static char *exclusive_descrip =
-"  MacroExclusive(macroname,arg1,arg2...):\n"
-"Executes macro defined in the context 'macro-macroname'\n"
-"Only one call at a time may run the macro.\n"
-"(we'll wait if another call is busy executing in the Macro)\n"
-"Arguments and return values as in application Macro()\n";
-
-static char *exit_descrip =
-"  MacroExit():\n"
-"Causes the currently running macro to exit as if it had\n"
-"ended normally by running out of priorities to execute.\n"
-"If used outside a macro, will likely cause unexpected\n"
-"behavior.\n";
-
 static char *app = "Macro";
 static char *if_app = "MacroIf";
 static char *exclusive_app = "MacroExclusive";
 static char *exit_app = "MacroExit";
 
-static char *synopsis = "Macro Implementation";
-static char *if_synopsis = "Conditional Macro Implementation";
-static char *exclusive_synopsis = "Exclusive Macro Implementation";
-static char *exit_synopsis = "Exit From Macro";
 
-
 static struct ast_exten *find_matching_priority(struct ast_context *c, const char *exten, int priority, const char *callerid)
 {
 	struct ast_exten *e;
@@ -524,10 +572,10 @@
 {
 	int res;
 
-	res = ast_register_application(exit_app, macro_exit_exec, exit_synopsis, exit_descrip);
-	res |= ast_register_application(if_app, macroif_exec, if_synopsis, if_descrip);
-	res |= ast_register_application(exclusive_app, macroexclusive_exec, exclusive_synopsis, exclusive_descrip);
-	res |= ast_register_application(app, macro_exec, synopsis, descrip);
+	res = ast_register_application_xml(exit_app, macro_exit_exec);
+	res |= ast_register_application_xml(if_app, macroif_exec);
+	res |= ast_register_application_xml(exclusive_app, macroexclusive_exec);
+	res |= ast_register_application_xml(app, macro_exec);
 
 	return res;
 }
Index: apps/app_waitforsilence.c
===================================================================
--- apps/app_waitforsilence.c	(revision 148806)
+++ apps/app_waitforsilence.c	(working copy)
@@ -48,37 +48,67 @@
 #include "asterisk/dsp.h"
 #include "asterisk/module.h"
 
+/*** DOCUMENTATION
+	<application name="WaitForSilence" language="en_US">
+		<synopsis>
+			Waits for a specified amount of silence
+		</synopsis>
+		<syntax>
+			<parameter name="silencerequired" required="true" />
+			<parameter name="iterations" />
+			<parameter name="timeout" />
+		</syntax>
+		<description>
+			<para>Waits for up to <literal>silencerequired</literal> in milliseconds of 
+			silence, 'iterations' times or once if omitted. An optional <literal>timeout</literal> 
+			specified the number of seconds to return after, even if we do not receive 
+			the specified amount of silence.</para>
+			<note><para>Use <literal>timeout</literal> with caution, as it may defeat 
+			the purpose of this application, which is to wait indefinitely until 
+			silence is detected on the line.  This is particularly useful for 
+			reverse-911-type call broadcast applications where you need to wait for 
+			an answering machine to complete its spiel before playing a message.</para>
+			<para>The timeout parameter is specified only to avoid an infinite loop in 
+			cases where silence is never achieved.  Typically you will want to include 
+			two or more calls to WaitForSilence when dealing with an answering machine; 
+			first waiting for the spiel to finish, then waiting for the beep, etc.</para>
+			</note>
+			<para>Examples:</para>
+			<para>WaitForSilence(500,2) will wait for 1/2 second of silence, twice </para>
+			<para>WaitForSilence(1000) will wait for 1 second of silence, once</para>
+			<para>WaitForSilence(300,3,10) will wait for 300ms silence, 3 times, and 
+			returns after 10 sec, even if silence is not detected</para>
+			<variablelist>
+				<variable name="WAITSTATUS">
+					<value name="SILENCE">
+						Exited with silence detected
+					</value>
+					<value name="TIMEOUT">
+						Exited without silence detected after timeout reached
+					</value>
+				</variable>
+			</variablelist>
+		</description>
+	</application>
+	<application name="WaitForNoise" language="en_US">
+		<synopsis>
+			Waits for a specified amount of noise.
+		</synopsis>
+		<syntax>
+			<parameter name="noiserequired" required="true" />
+			<parameter name="iterations" />
+			<parameter name="timeout" />
+		</syntax>
+		<description>
+			<para>The same as Wait for Silance but waits for noise that is above the 
+			threshold specified</para>
+		</description>
+	</application>
+			
+ ***/
 static char *app_silence = "WaitForSilence";
-static char *synopsis_silence = "Waits for a specified amount of silence";
-static char *descrip_silence =
-"  WaitForSilence(silencerequired[,iterations][,timeout]):\n"
-"Wait for Silence: Waits for up to 'silencerequired' \n"
-"milliseconds of silence, 'iterations' times or once if omitted.\n"
-"An optional timeout specified the number of seconds to return\n"
-"after, even if we do not receive the specified amount of silence.\n"
-"Use 'timeout' with caution, as it may defeat the purpose of this\n"
-"application, which is to wait indefinitely until silence is detected\n"
-"on the line.  This is particularly useful for reverse-911-type\n"
-"call broadcast applications where you need to wait for an answering\n"
-"machine to complete its spiel before playing a message.\n"
-"The timeout parameter is specified only to avoid an infinite loop in\n"
-"cases where silence is never achieved.  Typically you will want to\n"
-"include two or more calls to WaitForSilence when dealing with an answering\n"
-"machine; first waiting for the spiel to finish, then waiting for the beep, etc.\n\n"
-  "Examples:\n"
-"  - WaitForSilence(500,2) will wait for 1/2 second of silence, twice\n"
-"  - WaitForSilence(1000) will wait for 1 second of silence, once\n"
-"  - WaitForSilence(300,3,10) will wait for 300ms silence, 3 times,\n"
-"     and returns after 10 sec, even if silence is not detected\n\n"
-"Sets the channel variable WAITSTATUS with to one of these values:\n"
-"SILENCE - if exited with silence detected\n"
-"TIMEOUT - if exited without silence detected after timeout\n";
 
 static char *app_noise = "WaitForNoise";
-static char *synopsis_noise = "Waits for a specified amount of noise";
-static char *descrip_noise =
-"WaitForNoise(noiserequired[,iterations][,timeout]) \n"
-"Wait for Noise: The same as Wait for Silance but waits for noise that is above the threshold specified\n";
 
 static int do_waiting(struct ast_channel *chan, int timereqd, time_t waitstart, int timeout, int wait_for_silence) {
 	struct ast_frame *f;
@@ -218,8 +248,8 @@
 {
 	int res;
 
-	res = ast_register_application(app_silence, waitforsilence_exec, synopsis_silence, descrip_silence);
-	res |= ast_register_application(app_noise, waitfornoise_exec, synopsis_noise, descrip_noise);
+	res = ast_register_application_xml(app_silence, waitforsilence_exec);
+	res |= ast_register_application_xml(app_noise, waitfornoise_exec);
 	return res;
 }
 
Index: apps/app_waitforring.c
===================================================================
--- apps/app_waitforring.c	(revision 148806)
+++ apps/app_waitforring.c	(working copy)
@@ -35,13 +35,22 @@
 #include "asterisk/module.h"
 #include "asterisk/lock.h"
 
-static char *synopsis = "Wait for Ring Application";
+/*** DOCUMENTATION
+	<application name="WaitForRing" language="en_US">
+		<synopsis>
+			Wait for Ring Application.
+		</synopsis>
+		<syntax>
+			<parameter name="timeout" required="true" />
+		</syntax>
+		<description>
+			<para> Returns 0 after waiting at least timeout seconds. and 
+			only after the next ring has completed.  Returns 0 on 
+			success or -1 on hangup.</para>
+		</description>
+	</application>
+ ***/
 
-static char *desc = "  WaitForRing(timeout):\n"
-"Returns 0 after waiting at least timeout seconds. and\n"
-"only after the next ring has completed.  Returns 0 on\n"
-"success or -1 on hangup\n";
-
 static char *app = "WaitForRing";
 
 
@@ -111,7 +120,7 @@
 
 static int load_module(void)
 {
-	return ast_register_application(app, waitforring_exec, synopsis, desc);
+	return ast_register_application_xml(app, waitforring_exec);
 }
 
 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Waits until first ring after time");
