OK, I think this is a unix/windows file line endings issue. I suspect the original XML file uses unix line ending characters which the XmlTextReader doesn't like. Replace the CR characters with CR+LF and try that. Cheers ian -----Original Message----- From: program-l-bounce@xxxxxxxxxxxxx [mailto:program-l-bounce@xxxxxxxxxxxxx] On Behalf Of Pranav Lal Sent: 18 May 2011 14:21 To: program-l@xxxxxxxxxxxxx Subject: [program-l] Re: Visual Basic .net: getting XMLWriter not to access the Internet Hi Ian, I have the following code. Dim XMLWR As XmlTextWriter = New XmlTextWriter(tempFile, Nothing) XMLWR.Formatting = Formatting.Indented Dim xmlr As XmlTextReader Dim xss As New XmlReaderSettings xmlr = New XmlTextReader(ms) xmlr.WhitespaceHandling = WhitespaceHandling.None xss.IgnoreProcessingInstructions = True xss.ValidationType = ValidationType.None Dim reader As XmlReader = XmlReader.Create(xmlr, xss) 'convert the xml string to a file and read it back into an array list 'This also ensures that the string is read correctly into the arrayList. 'each element in the list corresponds to one line in the file. Try While reader.Read XMLWR.WriteNode(reader, False) End While Catch xx As Exception MsgBox(xx.Message) quit() End Try Try xmlr.Close() XMLWR.Flush() XMLWR.Close() Catch lx As Exception MsgBox("Error in writing temporary xml. Quitting") My.Application.Log.WriteException(lx) quit() End Try XMLWR = Nothing xmlr = Nothing I get the following error when this code runs. The server committed a protocol violation. Section=ResponseHeader Detail=CR must be followed by LF OK Pranav ** To leave the list, click on the immediately-following link:- ** [mailto:program-l-request@xxxxxxxxxxxxx?subject=unsubscribe] ** If this link doesn't work then send a message to: ** program-l-request@xxxxxxxxxxxxx ** and in the Subject line type ** unsubscribe ** For other list commands such as vacation mode, click on the ** immediately-following link:- ** [mailto:program-l-request@xxxxxxxxxxxxx?subject=faq] ** or send a message, to ** program-l-request@xxxxxxxxxxxxx with the Subject:- faq ** To leave the list, click on the immediately-following link:- ** [mailto:program-l-request@xxxxxxxxxxxxx?subject=unsubscribe] ** If this link doesn't work then send a message to: ** program-l-request@xxxxxxxxxxxxx ** and in the Subject line type ** unsubscribe ** For other list commands such as vacation mode, click on the ** immediately-following link:- ** [mailto:program-l-request@xxxxxxxxxxxxx?subject=faq] ** or send a message, to ** program-l-request@xxxxxxxxxxxxx with the Subject:- faq