Fix to XMLSerializer

archetype_node_id should be the archetype_id when the node_id is at0000
and the node_id otherwise.