The error is:
Error 1 There was an error while deserializing intermediate XML. 'Element' is an invalid XmlNodeType. Line 6, position 4.
Here is the Item Class:
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using System.Xml;
using Microsoft.Xna.Framework;
namespace RPG
{
class Item
{
protected string assetName;
protected string description;
protected Texture2D graphicIcon;
protected int goldValue;
protected bool dropable;
public void Load(string asset)
{
XmlDocument doc = new XmlDocument();
doc.Load(@"Content/Items/" + asset + ".xml");
foreach (XmlNode root in doc.ChildNodes)
{
foreach (XmlNode node in root.ChildNodes)
{
if (node.Name == "Asset")
assetName = node.InnerText;
if (node.Name == "Description")
description = node.InnerText;
if (node.Name == "GraphicIcon")
graphicIcon = LoadTexture(node.InnerText);
if (node.Name == "GoldValue")
goldValue = int.Parse(node.InnerText);
if (node.Name == "Dropable")
dropable = bool.Parse(node.InnerText);
}//end child nodes
}
}
protected Texture2D LoadTexture(string asset)
{
return Globals.Content.Load<Texture2D>("" + asset);
}
}
}
and XML code:
<?xml version="1.0" encoding="utf-8" ?>
<XnaContent>
<!-- TODO: replace this Asset with your own XML asset data. -->
<Asset Type="System.String"></Asset>
<Item>
<Asset>BronzeBand</Asset>
<Description>This worn ring looks rusted</Description>
<GoldValue>1</GoldValue>
<Dropable>true</Dropable>
</Item>
</XnaContent>