I am trying to publish an XML Page where I am updating the `Output` of the Page created in **Default Finish Actions** using a C# TBB. I am able to preview the Page in Tridion but while publishing, it is getting failed with the following error:

I have a page template which generate output in xml format. After default finish action on the PT, I have added a custom c# TBB which reads content from a certain component and adds few nodes to the already generated Output. After that, it simply pushes the Output into package.

> 
> The number of render failures has exceeded its specified failure limit of 0
> 
> 
> 

Error in event viewer in Tridion Template is as below

> 
> Hof.Tridion.BuildingBlocks.PageTemplates.GenerateMegaMenuXml.Transform(Engine engine, Package package) Component: Templating Errorcode: 0 User: NT 
>  AUTHORITY\SYSTEM StackTrace Information Details: at 
>  Hof.Tridion.BuildingBlocks.PageTemplates.GenerateMegaMenuXml.Transform(Engine engine, Package package) at Tridion.ContentManager.Templating.Assembly.AssemblyMediator.Transform(Engine engine, Template template, Package package) at Tridion.ContentManager.Templating.Assembly.CSharpSourceCodeMediator.RunTemplate(Engine engine, Package package, String templateUri, String className) at 
>  Tridion.Templating.CSharpTemplate.CSharpSourceTemplate.Transform(Engine \_\_engine, Package \_\_package) at Tridion.ContentManager.Templating.Assembly.CSharpSourceCodeMediator.Transform(Engine engine, Template template, Package package) at Tridion.ContentManager.Templating.Engine.ExecuteTemplate(Template template, Package package) at 
>  Tridion.ContentManager.Templating.Engine.InvokeTemplate(Package package, TemplateInvocation templateInvocation, Template template) at Tridion.ContentManager.Templating.Compound.CompoundTemplateMediator.Transform(Engine engine, Template templateToTransform, Package package) at Tridion.ContentManager.Templating.Engine.ExecuteTemplate(Template template, Package package) at Tridion.ContentManager.Templating.Engine.InvokeTemplate(Package package, TemplateInvocation templateInvocation, Template template) at Tridion.ContentManager.Templating.Engine.TransformItem(Template template, IdentifiableObject itemToRender) at Tridion.ContentManager.Templating.TemplatingRenderer.Render(ResolvedItem resolvedItem, PublishInstruction instruction, PublicationTarget target, RenderedItem renderedItem, RenderContext renderContext) 
> 
> 
> 

Can anyone suggest where else to check the exact root cause of issue.