Removed duplicate definition of document. Updated the NS map to include all namespaces.