Just discovered that this automatic conversion actually works (though possibly needs more testing).
If the attribute type is "string" then storing e4x object in it and later reading it back in another scripted block gives same e4x object without any explicit conversion.