How to Download and Save a XML File?

Hi everyone,

I have a problem when I try to download and save a XMLfile…

*IEnumerator DownloadAndSaveXML() {
	WWW www = new WWW (urlXML);
	yield return www;
		//Si hay error...
		if (www.error != null) {
			Debug.Log ("Error");
		//Sino lo hay
		else {
		//Si se ha descargado
		if (www.isDone) {
			XmlDocument xmlDoc = new XmlDocument ();
			xmlDoc.LoadXml (www.text);


I don’t know what is the problem…

XmlException: Text node cannot appear in this state. Line 1, position 1.
Mono.Xml2.XmlTextReader.ReadText (Boolean notWhitespace)
Mono.Xml2.XmlTextReader.ReadContent ()
Mono.Xml2.XmlTextReader.Read ()
System.Xml.XmlTextReader.Read ()
System.Xml.XmlDocument.ReadNodeCore (System.Xml.XmlReader reader)
System.Xml.XmlDocument.ReadNode (System.Xml.XmlReader reader)
System.Xml.XmlDocument.Load (System.Xml.XmlReader xmlReader)
System.Xml.XmlDocument.LoadXml (System.String xml)
Prueba+c__Iterator0.MoveNext () (at Assets/Scripts/Prueba.cs:75)

Re-save the XML file without the BOM.