我需要阅读以下 XML 文档并将所有字段保存在变量中以供以后使用。尝试过 Linq,但并不真正了解如何使用它。我需要帮助,我应该编写什么代码来读取 XML 并将字段保存在变量中?
<?xml version="1.0" encoding="utf-8"?>
<Map name="Mapa Prueba" width="30" height="30" hp="500" orobyte="50" Tx="1" Ty="5" Sx="30" Sy="25" >
<StructuresList>
<Structure name="Block de Notas" attack="0" i="1" j="1" range="0" price="8" />
<Structure name="Excel" attack="2" i="2" j="2" range="1" price="20" />
<Structure name="Word" attack="3" i="2" j="2" range="1" price="40" />
<Structure name="PowerPoint" attack="3" i="3" j="2" range="1" price="50" />
<Structure name="FireWall" attack="1" i="1" j="1" range="1" price="60" />
<Structure name="Avast" attack="4" i="3" j="3" range="2" price="80" />
<Structure name="Nod32" attack="4" i="3" j="2" range="2" price="110" />
<Structure name="Panda" attack="6" i="3" j="2" range="1" price="130" />
<Structure name="Norton" attack="5" i="3" j="3" range="2" price="150" />
<Structure name="Eclipse" attack="4" i="3" j="4" range="3" price="180" />
<Structure name="Visual Studio" attack="10" i="5" j="6" range="1" price="200" />
</StructuresList>
<EnemysList>
<Enemy id="00" color="rojo" hp="20" orobyte="1" speed="1" />
<Enemy id="01" color="azul" hp="10" orobyte="1" speed="2" />
<Enemy id="02" color="amarillo" hp="35" orobyte="3" speed="1" />
<Enemy id="03" color="celeste" hp="30" orobyte="2" speed="2" />
<Enemy id="04" color="azul" hp="10" orobyte="1" speed="4" />
<Enemy id="05" color="rojo" hp="60" orobyte="3" speed="1" />
<Enemy id="06" color="celeste" hp="100" orobyte="10" speed="1" />
<Enemy id="07" color="amarillo" hp="150" orobyte="25" speed="3" />
<Enemy id="08" color="verde" hp="200" orobyte="40" speed="5" />
</EnemysList>
<Waves>
<Wave>
<Group id="00" count="10" />
<Group id="01" count="5" />
</Wave>
<Wave>
<Group id="00" count="15" />
<Group id="01" count="5" />
</Wave>
<Wave>
<Group id="01" count="25" />
</Wave>
<Wave>
<Group id="00" count="24" />
<Group id="01" count="5" />
</Wave>
<Wave>
<Group id="02" count="20" />
</Wave>
<Wave>
<Group id="02" count="10" />
<Group id="03" count="20" />
</Wave>
<Wave>
<Group id="03" count="20" />
<Group id="07" count="1" />
</Wave>
<Wave>
<Group id="03" count="10" />
<Group id="04" count="30" />
</Wave>
<Wave>
<Group id="05" count="30" />
<Group id="06" count="10" />
<Group id="07" count="1" />
</Wave>
<Wave>
<Group id="08" count="3" />
</Wave>
</Waves>
</Map>