Index: trunk/src/VBox/Frontends/VirtualBox/include/COMWrappers.xsl
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/include/COMWrappers.xsl	(revision 4096)
+++ trunk/src/VBox/Frontends/VirtualBox/include/COMWrappers.xsl	(revision 4097)
@@ -102,11 +102,13 @@
 <xsl:text>
 /*
- * This contains Qt-based wrapper classes for [XP]COM interfaces.
+ *  DO NOT EDIT! This is a generated file.
  *
- * DO NOT EDIT! This is a generated file.
- * Generated from: src/VBox/Main/idl/VirtualBox.xidl (VirtualBox's interface definitions in XML)
- * Generator: src/VBox/Frontends/VirtualBox/include/COMWrappers.xsl
+ *  Qt-based wrapper classes for VirualBox Main API (COM interfaces)
+ *  generated from XIDL (XML interface definition).
  *
- * Note: this header must be included from COMDefs.h, never directly.
+ *  Source    : src/VBox/Main/idl/VirtualBox.xidl
+ *  Generator : src/VBox/Frontends/VirtualBox/include/COMWrappers.xsl
+ *
+ *  Note: this header must be included from COMDefs.h, never directly.
  */
 </xsl:text>
@@ -222,5 +224,5 @@
  *  libraries
 -->
-<xsl:template match="module">
+<xsl:template match="library">
     <!-- forward declarations -->
     <xsl:text>// forward declarations&#x0A;&#x0A;</xsl:text>
@@ -315,5 +317,5 @@
             </xsl:for-each>
         </xsl:if>
-        <!-- for definitions outside <if> (i.e. inside <module>) -->
+        <!-- for definitions outside <if> (i.e. inside <library>) -->
         <xsl:if test="name(..)!='if'">
             <xsl:for-each select="
@@ -405,5 +407,5 @@
         </xsl:for-each>
     </xsl:if>
-    <!-- for definitions outside <if> (i.e. inside <module>) -->
+    <!-- for definitions outside <if> (i.e. inside <library>) -->
     <xsl:if test="name(..)!='if'">
         <xsl:for-each select="
@@ -576,5 +578,5 @@
  *  co-classes
 -->
-<xsl:template match="class"/>
+<xsl:template match="module/class"/>
 
 
@@ -825,5 +827,5 @@
          ancestor-or-self::enumerator)[1]/@supportsErrorInfo
     "/>
-    <xsl:variable name="moduleSupportsErrorInfo" select="ancestor::module/@supportsErrorInfo"/>
+    <xsl:variable name="librarySupportsErrorInfo" select="ancestor::library/@supportsErrorInfo"/>
     <xsl:choose>
         <xsl:when test="$ifaceSupportsErrorInfo">
@@ -833,7 +835,7 @@
             </xsl:call-template>
         </xsl:when>
-        <xsl:when test="$moduleSupportsErrorInfo">
+        <xsl:when test="$librarySupportsErrorInfo">
             <xsl:call-template name="composeFetchErrorInfo">
-                <xsl:with-param name="supports" select="string($moduleSupportsErrorInfo)"/>
+                <xsl:with-param name="supports" select="string($librarySupportsErrorInfo)"/>
                 <xsl:with-param name="mode" select="$mode"/>
             </xsl:call-template>
@@ -916,6 +918,6 @@
         <!-- enum types -->
         <xsl:when test="
-            (ancestor::module/enum[@name=current()/@type]) or
-            (ancestor::module/if[@target=$self_target]/enum[@name=current()/@type])
+            (ancestor::library/enum[@name=current()/@type]) or
+            (ancestor::library/if[@target=$self_target]/enum[@name=current()/@type])
         ">
             <xsl:choose>
@@ -946,12 +948,12 @@
         <xsl:when test="
             @type='$unknown' or
-            ((ancestor::module/enumerator[@name=current()/@type]) or
-             (ancestor::module/if[@target=$self_target]/enumerator[@name=current()/@type])
+            ((ancestor::library/enumerator[@name=current()/@type]) or
+             (ancestor::library/if[@target=$self_target]/enumerator[@name=current()/@type])
             ) or
-            ((ancestor::module/interface[@name=current()/@type]) or
-             (ancestor::module/if[@target=$self_target]/interface[@name=current()/@type])
+            ((ancestor::library/interface[@name=current()/@type]) or
+             (ancestor::library/if[@target=$self_target]/interface[@name=current()/@type])
             ) or
-            ((ancestor::module/collection[@name=current()/@type]) or
-             (ancestor::module/if[@target=$self_target]/collection[@name=current()/@type])
+            ((ancestor::library/collection[@name=current()/@type]) or
+             (ancestor::library/if[@target=$self_target]/collection[@name=current()/@type])
             )
         ">
@@ -1107,6 +1109,6 @@
                         <!-- enum types -->
                         <xsl:when test="
-                            (ancestor::module/enum[@name=current()]) or
-                            (ancestor::module/if[@target=$self_target]/enum[@name=current()])
+                            (ancestor::library/enum[@name=current()]) or
+                            (ancestor::library/if[@target=$self_target]/enum[@name=current()])
                         ">
                             <xsl:value-of select="concat('CEnums::',string(.))"/>
@@ -1115,12 +1117,12 @@
                         <xsl:when test="
                             (name(current())='enumerator' and
-                             ((ancestor::module/enumerator[@name=current()]) or
-                              (ancestor::module/if[@target=$self_target]/enumerator[@name=current()]))
+                             ((ancestor::library/enumerator[@name=current()]) or
+                              (ancestor::library/if[@target=$self_target]/enumerator[@name=current()]))
                             ) or
-                            ((ancestor::module/interface[@name=current()]) or
-                             (ancestor::module/if[@target=$self_target]/interface[@name=current()])
+                            ((ancestor::library/interface[@name=current()]) or
+                             (ancestor::library/if[@target=$self_target]/interface[@name=current()])
                             ) or
-                            ((ancestor::module/collection[@name=current()]) or
-                             (ancestor::module/if[@target=$self_target]/collection[@name=current()])
+                            ((ancestor::library/collection[@name=current()]) or
+                             (ancestor::library/if[@target=$self_target]/collection[@name=current()])
                             )
                         ">
@@ -1220,6 +1222,6 @@
                         <!-- enum types initialized with 0 -->
                         <xsl:when test="
-                            (ancestor::module/enum[@name=current()]) or
-                            (ancestor::module/if[@target=$self_target]/enum[@name=current()])
+                            (ancestor::library/enum[@name=current()]) or
+                            (ancestor::library/if[@target=$self_target]/enum[@name=current()])
                         ">
                             <xsl:value-of select="concat(' = (CEnums::',string(.),') 0')"/>
@@ -1245,16 +1247,16 @@
             .='string' or
             .='wstring' or
-            ((ancestor::module/enum[@name=current()]) or
-             (ancestor::module/if[@target=$self_target]/enum[@name=current()])
+            ((ancestor::library/enum[@name=current()]) or
+             (ancestor::library/if[@target=$self_target]/enum[@name=current()])
             ) or
             .='$unknown' or
-            ((ancestor::module/enumerator[@name=current()]) or
-             (ancestor::module/if[@target=$self_target]/enumerator[@name=current()])
+            ((ancestor::library/enumerator[@name=current()]) or
+             (ancestor::library/if[@target=$self_target]/enumerator[@name=current()])
             ) or
-            ((ancestor::module/interface[@name=current()]) or
-             (ancestor::module/if[@target=$self_target]/interface[@name=current()])
+            ((ancestor::library/interface[@name=current()]) or
+             (ancestor::library/if[@target=$self_target]/interface[@name=current()])
             ) or
-            ((ancestor::module/collection[@name=current()]) or
-             (ancestor::module/if[@target=$self_target]/collection[@name=current()])
+            ((ancestor::library/collection[@name=current()]) or
+             (ancestor::library/if[@target=$self_target]/collection[@name=current()])
             )
         ">
Index: trunk/src/VBox/Main/idl/VirtualBox.xidl
===================================================================
--- trunk/src/VBox/Main/idl/VirtualBox.xidl	(revision 4096)
+++ trunk/src/VBox/Main/idl/VirtualBox.xidl	(revision 4097)
@@ -9,20 +9,35 @@
  *
  * From this document, the build system generates several files
- * via XSLT that are then used during the build process:
+ * via XSLT that are then used during the build process.
  *
- *   -  out/<platform>/bin/sdk/idl/VirtualBox[_XPCOM].idl, a
- *      COM/XPCOM interface definition file (IDL)
+ * Below is the list of XSL templates that operate on this file and
+ * output files they generate. These XSL templates must be updated
+ * whenever the schema of this file changes:
  *
- *   -  out/<platform>/bin/sdk/include/VirtualBox[_XPCOM].h, which
- *      gets included from the include/VBox/com/VirtualBox.h
- *      wrapper, to allow clients to access the COM/XPCOM API;
+ * 1. src/VBox/Main/idl/midl.xsl =>
+ *    out/<platform>/bin/sdk/idl/VirtualBox.idl
+ *    (MS COM interface definition file for Main API)
+ * 
+ * 2. src/VBox/Main/idl/xpidl.xsl =>
+ *    out/<platform>/bin/sdk/idl/VirtualBox_XPCOM.idl
+ *    (XPCOM interface definition file for Main API)
  *
- *   -  also, another intermediate file that is then used to
- *      produce the official Doxygen documentation of the API.
+ * 3. src/VBox/Main/idl/doxygen.xsl =>
+ *    out/<platform>/obj/src/VBox/Main/VirtualBox.idl
+ *    (pseudo-IDL for Doxygen to generate the official Main API
+ *     documentation)
  *
- *   -  a lot of files for the web service by XSLT stylesheets
- *      in the ../webservice directory; the targets include a
- *      WSDL file that describes the web service and C++ method
- *      mappers that map SOAP messages to COM calls.
+ * 4. src/VBox/Main/idl/webservice/*.xsl =>
+ *    a bunch of WSDL and C++ files
+ *    (VirtualBox web service sources and SOAP mappers)
+ *
+ * 5. src/VBox/Frontends/VirtualBox/include/COMWrappers.xsl =>
+ *    out/<platform>/obj/src/VBox/Frontends/VirtualBox/VirtualBox/include/COMWrappers.h
+ *    (smart Qt-based C++ wrapper classes for COM interfaces
+ *     of the Main API)
+ *
+ * 6. src/VBox/Installer/win32/VirtualBox_TypeLib.xsl =>
+ *    out/<platform>/obj/src/VBox/Installer/win32/VirtualBox_TypeLib.wxi
+ *    (Main API TypeLib block for the WiX installer)
  *
      Copyright (C) 2006-2007 innotek GmbH
@@ -67,9 +82,10 @@
 </if>
 
-<module
+<library
    name="VirtualBox"
    uuid="46137EEC-703B-4fe5-AFD4-7C9BBBBA0259"
    version="1.3"
    desc="innotek VirtualBox Type Library"
+   appUuid="819B4D85-9CEE-493C-B6FC-64FFE759B3C9"
    supportsErrorInfo="yes"
 >
@@ -1608,9 +1624,4 @@
 
   </interface>
-
-  <class name="VirtualBox" uuid="B1A7A4F2-47B9-4A1E-82B2-07CCD5323C3F"
-         namespace="virtualbox.org">
-    <interface name="IVirtualBox" default="yes"/>
-  </class>
 
   <!--
@@ -8084,9 +8095,4 @@
   </interface>
 
-  <class name="Session" uuid="3C02F46D-C9D2-4f11-A384-53F0CF917214"
-         namespace="virtualbox.org">
-    <interface name="ISession" default="yes"/>
-  </class>
-
 <if target="wsdl">
 
@@ -8121,5 +8127,19 @@
 </if>
 
-</module>
+  <module name="VBoxSVC" context="LocalServer">
+    <class name="VirtualBox" uuid="B1A7A4F2-47B9-4A1E-82B2-07CCD5323C3F"
+           namespace="virtualbox.org">
+      <interface name="IVirtualBox" default="yes"/>
+    </class>
+  </module>
+
+  <module name="VBoxC" context="InprocServer" threadingModel="Free">
+    <class name="Session" uuid="3C02F46D-C9D2-4f11-A384-53F0CF917214"
+           namespace="virtualbox.org">
+      <interface name="ISession" default="yes"/>
+    </class>
+  </module>
+
+</library>
 
 </idl>
Index: trunk/src/VBox/Main/idl/doxygen.xsl
===================================================================
--- trunk/src/VBox/Main/idl/doxygen.xsl	(revision 4096)
+++ trunk/src/VBox/Main/idl/doxygen.xsl	(revision 4097)
@@ -269,9 +269,15 @@
 <xsl:template match="/idl">
 /*
- *  DO NOT EDIT.
- *
- *  This IDL is automatically generated from the generic interface definition
- *  using some generic OMG IDL-like syntax SOLELY for the purpose of generating
- *  the documentation using Doxygen and is not syntactically valid.
+ *  DO NOT EDIT! This is a generated file.
+ *
+ *  Doxygen IDL definition for VirualBox Main API (COM interfaces)
+ *  generated from XIDL (XML interface definition).
+ *
+ *  Source    : src/VBox/Main/idl/VirtualBox.xidl
+ *  Generator : src/VBox/Main/idl/doxygen.xsl
+ *
+ *  This IDL is generated using some generic OMG IDL-like syntax SOLELY
+ *  for the purpose of generating the documentation using Doxygen and
+ *  is not syntactically valid.
  *
  *  DO NOT USE THIS HEADER IN ANY OTHER WAY!
@@ -340,5 +346,5 @@
  *  libraries
 -->
-<xsl:template match="module">
+<xsl:template match="library">
     <!-- all enums go first -->
     <xsl:apply-templates select="enum | if/enum"/>
@@ -420,5 +426,5 @@
  *  co-classes
 -->
-<xsl:template match="class">
+<xsl:template match="module/class">
     <!-- class and contract id: later -->
     <!-- CLSID_xxx declarations for XPCOM, for compatibility with Win32: later -->
@@ -633,6 +639,6 @@
                         <!-- enum types -->
                         <xsl:when test="
-                            (ancestor::module/enum[@name=current()]) or
-                            (ancestor::module/if[@target=$self_target]/enum[@name=current()])
+                            (ancestor::library/enum[@name=current()]) or
+                            (ancestor::library/if[@target=$self_target]/enum[@name=current()])
                         ">
                             <xsl:value-of select="."/>
@@ -641,12 +647,12 @@
                         <xsl:when test="
                             (name(current())='enumerator' and
-                             ((ancestor::module/enumerator[@name=current()]) or
-                              (ancestor::module/if[@target=$self_target]/enumerator[@name=current()]))
+                             ((ancestor::library/enumerator[@name=current()]) or
+                              (ancestor::library/if[@target=$self_target]/enumerator[@name=current()]))
                             ) or
-                            ((ancestor::module/interface[@name=current()]) or
-                             (ancestor::module/if[@target=$self_target]/interface[@name=current()])
+                            ((ancestor::library/interface[@name=current()]) or
+                             (ancestor::library/if[@target=$self_target]/interface[@name=current()])
                             ) or
-                            ((ancestor::module/collection[@name=current()]) or
-                             (ancestor::module/if[@target=$self_target]/collection[@name=current()])
+                            ((ancestor::library/collection[@name=current()]) or
+                             (ancestor::library/if[@target=$self_target]/collection[@name=current()])
                             )
                         ">
Index: trunk/src/VBox/Main/idl/midl.xsl
===================================================================
--- trunk/src/VBox/Main/idl/midl.xsl	(revision 4096)
+++ trunk/src/VBox/Main/idl/midl.xsl	(revision 4097)
@@ -74,8 +74,11 @@
     <xsl:text>
 /*
- *  DO NOT EDIT.
+ *  DO NOT EDIT! This is a generated file.
  *
- *  This IDL is automatically generated from the generic interface definition
- *  using MS IDL (MIDL) syntax.
+ *  MS IDL (MIDL) definition for VirualBox Main API (COM interfaces)
+ *  generated from XIDL (XML interface definition).
+ *
+ *  Source    : src/VBox/Main/idl/VirtualBox.xidl
+ *  Generator : src/VBox/Main/idl/midl.xsl
  */
     </xsl:text>
@@ -127,5 +130,5 @@
  *  libraries
 -->
-<xsl:template match="module">[
+<xsl:template match="library">[
     uuid(<xsl:value-of select="@uuid"/>),
     version(<xsl:value-of select="@version"/>),
@@ -256,5 +259,5 @@
  *  co-classes
 -->
-<xsl:template match="class">[
+<xsl:template match="module/class">[
     uuid(<xsl:value-of select="@uuid"/>)
 ]
@@ -525,6 +528,6 @@
                         <!-- enum types -->
                         <xsl:when test="
-                            (ancestor::module/enum[@name=current()]) or
-                            (ancestor::module/if[@target=$self_target]/enum[@name=current()])
+                            (ancestor::library/enum[@name=current()]) or
+                            (ancestor::library/if[@target=$self_target]/enum[@name=current()])
                         ">
                             <xsl:value-of select="."/>
@@ -533,12 +536,12 @@
                         <xsl:when test="
                             (name(current())='enumerator' and
-                             ((ancestor::module/enumerator[@name=current()]) or
-                              (ancestor::module/if[@target=$self_target]/enumerator[@name=current()]))
+                             ((ancestor::library/enumerator[@name=current()]) or
+                              (ancestor::library/if[@target=$self_target]/enumerator[@name=current()]))
                             ) or
-                            ((ancestor::module/interface[@name=current()]) or
-                             (ancestor::module/if[@target=$self_target]/interface[@name=current()])
+                            ((ancestor::library/interface[@name=current()]) or
+                             (ancestor::library/if[@target=$self_target]/interface[@name=current()])
                             ) or
-                            ((ancestor::module/collection[@name=current()]) or
-                             (ancestor::module/if[@target=$self_target]/collection[@name=current()])
+                            ((ancestor::library/collection[@name=current()]) or
+                             (ancestor::library/if[@target=$self_target]/collection[@name=current()])
                             )
                         ">
Index: trunk/src/VBox/Main/idl/xpidl.xsl
===================================================================
--- trunk/src/VBox/Main/idl/xpidl.xsl	(revision 4096)
+++ trunk/src/VBox/Main/idl/xpidl.xsl	(revision 4097)
@@ -71,7 +71,11 @@
     <xsl:text>
 /*
-# DO NOT EDIT! This is a generated file.
-# Generated from: src/VBox/Main/idl/VirtualBox.xidl (VirtualBox's interface definitions in XML)
-# Generator: src/VBox/Main/idl/xpidl.xsl
+ *  DO NOT EDIT! This is a generated file.
+ *
+ *  XPCOM IDL (XPIDL) definition for VirualBox Main API (COM interfaces)
+ *  generated from XIDL (XML interface definition).
+ *
+ *  Source    : src/VBox/Main/idl/VirtualBox.xidl
+ *  Generator : src/VBox/Main/idl/xpidl.xsl
  */
 
@@ -156,5 +160,5 @@
  *  libraries
 -->
-<xsl:template match="module">
+<xsl:template match="library">
     <!-- forward declarations -->
     <xsl:apply-templates select="if | interface | collection | enumerator" mode="forward"/>
@@ -261,5 +265,5 @@
  *  co-classes
 -->
-<xsl:template match="class">
+<xsl:template match="module/class">
     <!-- class and contract id -->
     <xsl:text>%{C++&#x0A;</xsl:text>
@@ -559,6 +563,6 @@
                         <!-- enum types -->
                         <xsl:when test="
-                            (ancestor::module/enum[@name=current()]) or
-                            (ancestor::module/if[@target=$self_target]/enum[@name=current()])
+                            (ancestor::library/enum[@name=current()]) or
+                            (ancestor::library/if[@target=$self_target]/enum[@name=current()])
                         ">
                             <xsl:text>PRUint32</xsl:text>
@@ -567,12 +571,12 @@
                         <xsl:when test="
                             (name(current())='enumerator' and
-                             ((ancestor::module/enumerator[@name=current()]) or
-                              (ancestor::module/if[@target=$self_target]/enumerator[@name=current()]))
+                             ((ancestor::library/enumerator[@name=current()]) or
+                              (ancestor::library/if[@target=$self_target]/enumerator[@name=current()]))
                             ) or
-                            ((ancestor::module/interface[@name=current()]) or
-                             (ancestor::module/if[@target=$self_target]/interface[@name=current()])
+                            ((ancestor::library/interface[@name=current()]) or
+                             (ancestor::library/if[@target=$self_target]/interface[@name=current()])
                             ) or
-                            ((ancestor::module/collection[@name=current()]) or
-                             (ancestor::module/if[@target=$self_target]/collection[@name=current()])
+                            ((ancestor::library/collection[@name=current()]) or
+                             (ancestor::library/if[@target=$self_target]/collection[@name=current()])
                             )
                         ">
