Update
I have found a new method for converting numeric strings using an internal function that was previously unknown to me. It is quite flexible, but its use requires care as bad input will crash the kernel. I have detailed my present understanding of the function here: ParseTable syntaxParseTable syntax.
Does this work for you?
hexNodeData /.
XMLElement[a_, {}, {s_String}] :>
XMLElement[a, {}, ImportString[s, "List"]]
I am using ImportString[s, "List"]
to convert numbers in the 5.0000e+000
form.
You commented that this works, but is slow; indeed it is, but I don't have a better method for you, only alternatives. This question's answers give some:
How do you convert a string containing a number in C scientific notation to a Mathematica number?How do you convert a string containing a number in C scientific notation to a Mathematica number?
If your number were lower precision you could use Internal`StringToDouble
but e.g. Internal`StringToDouble["3.141592653589793e+000"]
gives $Failed["Bignum"]
. Using ToExpression
can be dangerous, because as Szabolcs states:
Whenever you use
ToExpression
on data read from a file, you make it possible to inject code into a program even inadvertently (one can never tell what sort of erroneous input the program might get by mistake).
Nevertheless it should be faster, so I present a method using it if you choose to risk it:
Block[{e},
hexNodeData /.
XMLElement[a_, {}, {s_String}] :>
XMLElement[a, {}, {ToExpression @ s}]
/. {e x_ + b_ :> x*10^b, e x_ :> x}
]