title: Convert Xml hexadecimal values to integer in c#
body: <p>I have the following xml:</p>
  
  <pre><code>&lt;RootLevel&gt;
    &lt;Level1 type="Integer" value="0x53494553"/&gt;
    &lt;Level1 type="Float" value="0x07"/&gt;
    &lt;Level1 type="Short" value="0x0002"/&gt;
    &lt;Level1 type="Short" value="0x0000"/&gt;
  &lt;RootLevel&gt;
  </code></pre>
  
  <p>Respect to this xml, i get the Type value and cast them with no problem. But when i try to parse the hexadecimal values with </p>
  
  <pre><code>Convert.ToInt32(node.Attributes["value"].Value)
  or
  Convert.ToInt32(node.Attributes["value"].Value,NumberStyles.HexNumber)
  or
  int.Parse(node.Attributes["value"].Value)
  or
  int.Parse(node.Attributes["value"].Value, NumberStyles.HexNumber)
  </code></pre>
  
  <p>It gives the following error:</p>
  
  <p>Input string was not in a correct format.</p>
  
  <p>In case i am trying to parse into integer but for every dataType it will be similar. Parsing for integer help is enough.</p>
  
  <p>What am i missing here?</p>