fix complex type handling for NULL values
handle namespace prefixes for elements and attributes