private void WriteReport(InstallItem line, string path)
        {
            var dataFile = "<Result><Item></Item></Result>";

            using (var writer = new StreamWriter(GetNewStream(path)))
            {
                var aml = new StringBuilder();

                using (var amlWriter = new System.IO.StringWriter(aml))
                {
                    using (var xml = new ConfigurableXmlWriter(amlWriter))
                    {
                        xml.ElementProcessor = (prefix, localName, ns, w) =>
                        {
                            if (localName == "xsl_stylesheet")
                            {
                                return(ProcessState.DontRender);
                            }
                            return(ProcessState.RenderAll);
                        };

                        xml.WriteStartElement("AML");
                        line.Script.WriteTo(xml);
                        xml.WriteEndElement();
                    }
                }

                writer.WriteLine(_reportStart);
                writer.WriteLine(aml);
                writer.WriteLine(_reportEnd);

                var xsltElem = line.Script.SelectSingleNode(".//xsl_stylesheet") as XmlElement;
                if (xsltElem != null)
                {
                    var xslt      = xsltElem.InnerText;
                    var dataStart = xslt.IndexOf(_reportDataStart);
                    var dataEnd   = xslt.IndexOf(_reportDataEnd);
                    if (dataStart >= 0 && dataEnd >= 0)
                    {
                        dataFile = xslt.Substring(dataStart + _reportDataStart.Length, dataEnd - dataStart - _reportDataStart.Length).Trim();
                        xslt     = xslt.Substring(0, dataStart).Trim() + Environment.NewLine + xslt.Substring(dataEnd + _reportDataEnd.Length).Trim();
                    }
                    else
                    {
                        dataFile = xsltElem.Parent().Element("report_query", "<Result><Item></Item></Result>");
                    }
                    dataFile = XmlUtils.RemoveComments(dataFile);

                    writer.WriteLine(xslt);
                }
            }

            using (var writer = new StreamWriter(GetNewStream(path + ".xml")))
            {
                writer.Write(dataFile);
            }
        }
    private void WriteReport(InstallItem line, string path)
    {
      var dataFile = "<Result><Item></Item></Result>";

      using (var writer = new StreamWriter(GetNewStream(path)))
      {
        var aml = new StringBuilder();

        using (var amlWriter = new System.IO.StringWriter(aml))
        {
          using (var xml = new ConfigurableXmlWriter(amlWriter))
          {
            xml.ElementProcessor = (prefix, localName, ns, w) =>
            {
              if (localName == "xsl_stylesheet") return ProcessState.DontRender;
              return ProcessState.RenderAll;
            };

            xml.WriteStartElement("AML");
            line.Script.WriteTo(xml);
            xml.WriteEndElement();
          }
        }

        writer.WriteLine(_reportStart);
        writer.WriteLine(aml);
        writer.WriteLine(_reportEnd);

        var xsltElem = line.Script.SelectSingleNode(".//xsl_stylesheet") as XmlElement;
        if (xsltElem != null)
        {
          var xslt = xsltElem.InnerText;
          var dataStart = xslt.IndexOf(_reportDataStart);
          var dataEnd = xslt.IndexOf(_reportDataEnd);
          if (dataStart >= 0 && dataEnd >= 0)
          {
            dataFile = xslt.Substring(dataStart + _reportDataStart.Length, dataEnd - dataStart - _reportDataStart.Length).Trim();
            xslt = xslt.Substring(0, dataStart).Trim() + Environment.NewLine + xslt.Substring(dataEnd + _reportDataEnd.Length).Trim();
          }
          else
          {
            dataFile = xsltElem.Parent().Element("report_query", "<Result><Item></Item></Result>");
          }

          writer.WriteLine(xslt);
        }
      }

      using (var writer = new StreamWriter(GetNewStream(path + ".xml")))
      {
        writer.Write(dataFile);
      }
    }