I need a code documentation tool similar to javadoc or c# xml doc for delphi code. What is the best tool? I prefer a technology, which is in the future compatible to the Microsoft sandcastle project.
As far as I'm aware, there is no tool easily compatible with Microsoft Sandcastle - at least until somebody actually bothers to write one, to modify an existing one, or to create a toolchain to properly transform the output.
I've personally used PasDoc with great success. I recommend building the latest SVN version, since the current release occasionally croaks on complicated interface definitions.
Sandcastle needs to get access to the assemblies in order to generate it's documentation, which means that it is only applicable for .net languages (although I'm not sure able Delphi.Net). However, Delphi 2007 and 2009 has an inline XML documentation very similar to C#. When you switch on the 'generate XML documentation' option in the project options, it will build XML documentation based on these comments. XSLT can then be used to generate whatever documentation format you need (this is the difficult bit).
Since Delphi 2005 it is build in the Delphi compiler. It uses the XMLDoc standard which uses XML style comments. Just as C# does, so I guess Sandcastle can handle it. See http://dn.codegear.com/article/32770 and http://tondrej.blogspot.com/2006/03/xml-documentation-in-delphi-2006.html
Also see http://stackoverflow.com/questions/33336/documenting-delphi
DelphiCodeToDoc also have a command-line to use it with continuous integration tool (for example).