An application I've been working on requires MSXML4 for validating instance documents against an embedded schema, but one of the installation requirements is that it must be able to be installed by a non-administrator. The offical Microsoft installer requires administrator privileges so this option is out. This caused a few headaches.
Then I remembered that application manifests can specify a list of COM objects exposed by a local DLL. This led to a solution that works, but is not Microsoft-approved.
The trick is to install MSXML4 in side-by-side mode on the development box (use the custom install option), then navigate to the \Windows\WinSxS folder. In the Manifests subfolder you'll find .manifest files for the side-by-side installations of MSXML4.dll (the manifest filename includes MSXML2, which is the library's COM namespace) and MSXML4R.dll (the manifest filename includes MSXML2R). The MSXML4R version number must match the value in the MSXML4 element.
Copy the entire element from both the MSXML4 and MSXML4R manifests into your application manifest's element (but don't copy MSXML4's element). Now MSXML4 is part of your assembly.
Also copy the matching DLLs from the \Windows\WinSxS tree to your application folder and voila! MSXML4 can be installed and used by a non-administrator.
Your application's folder should also have a appname.exe.local file so the COM redirector will force the local MSXML4 DLLs to always be used.
Important things to remember are that this scenario is not supported by Microsoft and that any updates to the MSXML4 files must be serviced by your application.
So an example manifest for Foo.exe using MSXML 4.0 SP2 (MSXML4.dll version 4.20.9818.0 and MSXML4R.dll version 4.1.0.0) should look something like this:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity type="win32" name="Foo.exe" version="1.0.0.0" processorArchitecture="X86"/>
<file name="msxml4.dll" hash="80e5fb356b5f5cfe6f765a9ffe1eb749642a2e0f" hashalg="SHA1">
<typelib tlbid="{f5078f18-c551-11d3-89b9-0000f81fe221}" version="4.0" helpdir=""/>
<comClass description="W3C-DOM XML Document (Apartment)"
clsid="{88d969c0-f192-11d4-a65f-0040963251e5}"
threadingModel="Apartment"
progid="MSXML2.DOMDocument.4.0"
tlbid="{f5078f18-c551-11d3-89b9-0000f81fe221}"/>
<comClass description="W3C-DOM XML Document (Free threaded)"
clsid="{88d969c1-f192-11d4-a65f-0040963251e5}"
threadingModel="Free"
progid="MSXML2.FreeThreadedDOMDocument.4.0"
tlbid="{f5078f18-c551-11d3-89b9-0000f81fe221}"/>
<comClass description="Object for caching schemas"
clsid="{88d969c2-f192-11d4-a65f-0040963251e5}"
threadingModel="Free"
progid="MSXML2.XMLSchemaCache.4.0"
tlbid="{f5078f18-c551-11d3-89b9-0000f81fe221}"/>
<comClass description="Object for caching compiled XSL stylesheets"
clsid="{88d969c3-f192-11d4-a65f-0040963251e5}"
threadingModel="Free"
progid="MSXML2.XSLTemplate.4.0"
tlbid="{f5078f18-c551-11d3-89b9-0000f81fe221}"/>
<comClass description="XML Data Source Object"
clsid="{88d969c4-f192-11d4-a65f-0040963251e5}"
threadingModel="Apartment"
progid="MSXML2.DSOControl.4.0"
tlbid="{f5078f18-c551-11d3-89b9-0000f81fe221}"/>
<comClass description="XML HTTP Request class."
clsid="{88d969c5-f192-11d4-a65f-0040963251e5}"
threadingModel="Apartment"
progid="MSXML2.XMLHTTP.4.0"
tlbid="{f5078f18-c551-11d3-89b9-0000f81fe221}"/>
<comClass description="Server XML HTTP Request class."
clsid="{88d969c6-f192-11d4-a65f-0040963251e5}"
threadingModel="Apartment"
progid="MSXML2.ServerXMLHTTP.4.0"
tlbid="{f5078f18-c551-11d3-89b9-0000f81fe221}"/>
<comClass description="SAX XML Reader 4.0 coclass"
clsid="{7c6e29bc-8b8b-4c3d-859e-af6cd158be0f}"
threadingModel="Both"
progid="MSXML2.SAXXMLReader.4.0"
tlbid="{f5078f18-c551-11d3-89b9-0000f81fe221}"/>
<comClass description="Microsoft XML Writer 4.0 coclass"
clsid="{88d969c8-f192-11d4-a65f-0040963251e5}"
threadingModel="Both"
progid="MSXML2.MXXMLWriter.4.0"
tlbid="{f5078f18-c551-11d3-89b9-0000f81fe221}"/>
<comClass description="Microsoft HTML Writer 4.0 coclass"
clsid="{88d969c9-f192-11d4-a65f-0040963251e5}"
threadingModel="Both"
progid="MSXML2.MXHTMLWriter.4.0"
tlbid="{f5078f18-c551-11d3-89b9-0000f81fe221}"/>
<comClass description="SAX Attributes 4.0 coclass"
clsid="{88d969ca-f192-11d4-a65f-0040963251e5}"
threadingModel="Both"
progid="MSXML2.SAXAttributes.4.0"
tlbid="{f5078f18-c551-11d3-89b9-0000f81fe221}"/>
<comClass description="MX Namespace Manager 4.0 coclass"
clsid="{88d969d6-f192-11d4-a65f-0040963251e5}"
threadingModel="Both"
progid="MSXML2.MXNamespaceManager.4.0"
tlbid="{f5078f18-c551-11d3-89b9-0000f81fe221}"/>
</file>
<file name="msxml4r.dll" hash="e09c7d1cb933719ab19ddae866e6cc0846eccdc4" hashalg="SHA1"/>
</assembly>