Unpickling From XML

Finally, we convert the simplified representation into the desired Oz value:

fun {Convert E Stack}
   case E
   of text(   S) then S|Stack
   [] info(   L) then {Convert L nil}|Stack
   [] name(   L) then {String.toAtom {Convert L nil}.1}|Stack
   [] age(    L) then {String.toInt  {Convert L nil}.1}|Stack
   [] married(L) then {ToBool        {Convert L nil}.1}|Stack
   [] H|T        then {Convert H {Convert T Stack}}
   [] nil        then Stack
   end
end

fun {FromFile F}
   {Convert {Simplify {XMLFromFile F}} nil}
end