change type comparison to instnaceof
add python3 stdlib xml element support