public string OutputNode (ProjectDom dom, AstNode node, string indent)
		{
			StringWriter w = new StringWriter();
			var policyParent = dom != null && dom.Project != null ? dom.Project.Policies : null;
			IEnumerable<string> types = DesktopService.GetMimeTypeInheritanceChain (CSharpFormatter.MimeType);
			CSharpFormattingPolicy codePolicy = policyParent != null ? policyParent.Get<CSharpFormattingPolicy> (types) : MonoDevelop.Projects.Policies.PolicyService.GetDefaultPolicy<CSharpFormattingPolicy> (types);
			var formatter = new TextWriterOutputFormatter(w);
			int col = GetColumn (indent, 0, 4);
			formatter.Indentation = System.Math.Max (0, col / 4);
			OutputVisitor visitor = new OutputVisitor (formatter, codePolicy.CreateOptions ());
			node.AcceptVisitor (visitor, null);
			return w.ToString();
		}
		static string OutputNode (MonoDevelop.Ide.Gui.Document doc, AstNode node)
		{
			using (var stringWriter = new System.IO.StringWriter ()) {
//				formatter.Indentation = indentLevel;
				var formatter = new TextWriterOutputFormatter (stringWriter);
				stringWriter.NewLine = doc.Editor.EolMarker;
				
				var visitor = new CSharpOutputVisitor (formatter, doc.GetFormattingOptions ());
				node.AcceptVisitor (visitor);
				return stringWriter.ToString ();
			}
		}
		void AppendReturnType (StringBuilder result, CodeGenerationOptions options, IType type)
		{
			if (type == null)
				throw new ArgumentNullException ("type");
			var implementingType = options.Part;
			var loc = implementingType.Region.End;
			
			var pf = implementingType.UnresolvedFile;
			var file = pf as CSharpUnresolvedFile;
			var resolved = type;
			if (resolved.Kind == TypeKind.Unknown) {
				result.Append (type.FullName);
				return;
			}
			var def = type.GetDefinition ();
			if (def != null) {
				using (var stringWriter = new System.IO.StringWriter ()) {
					var formatter = new TextWriterOutputFormatter (stringWriter);
					stringWriter.NewLine = EolMarker; 
					var visitor = new CSharpOutputVisitor (formatter, FormattingOptionsFactory.CreateMono ());
					var shortType = CreateShortType (def.Compilation, file, loc, resolved);
					shortType.AcceptVisitor (visitor);
					
					var typeString = stringWriter.ToString ();
					if (typeString.StartsWith ("global::"))
						typeString = typeString.Substring ("global::".Length);
					result.Append (typeString);
				}
			} else {
				result.Append (new ICSharpCode.NRefactory.CSharp.CSharpAmbience ().ConvertType (type));
			}
		}
		public string OutputNode (AstNode node)
		{
			using (var stringWriter = new System.IO.StringWriter ()) {
				var formatter = new TextWriterOutputFormatter (stringWriter);
//				formatter.Indentation = indentLevel;
				stringWriter.NewLine = Document.Editor.EolMarker;
				
				var visitor = new CSharpOutputVisitor (formatter, FormattingOptionsFactory.CreateMono ());
				node.AcceptVisitor (visitor);
				return stringWriter.ToString ();
			}
		}