I have an xml file of size 567 MB and i wanna to split it into multiple xml files based on tag, I tried then below code, but im facing out of memory execption, so please le tme know how to allocate memory for sucha a large file.\[code\] string strFileName; string strSeq; XmlReader doc = XmlReader.Create("D:\\SaiChandan\\Morning Star\\xml work\\Testing\\DataWarehouse36_FO_USA_D_20121207.xml"); while (doc.Read()) { if (doc.Name == "Package") { strSeq = doc.GetAttribute("InvestmentVehicle _Id"); XmlDocument outdoc = new XmlDocument(); XmlDeclaration xmlDeclaration = outdoc.CreateXmlDeclaration("1.0", "utf-8", null); XmlElement rootNode = outdoc.CreateElement(doc.Name); rootNode.InnerXml = doc.ReadInnerXml(); outdoc.InsertBefore(xmlDeclaration, outdoc.DocumentElement); outdoc.AppendChild(rootNode); strFileName = "test" + strSeq + ".xml"; outdoc.Save("D:\\SaiChandan\\Morning Star\\xml work\\Testing\\" + strFileName); }\[/code\]