Have PrettyXMLSerializer cooperate with namespace manager

diff -r e09fb5e705ac rdflib/syntax/serializers/PrettyXMLSerializer.py
--- a/rdflib/syntax/serializers/PrettyXMLSerializer.py	Wed Jul 04 09:50:53 2007 +0200
+++ b/rdflib/syntax/serializers/PrettyXMLSerializer.py	Wed Jul 04 09:59:12 2007 +0200
@@ -33,17 +33,19 @@ class PrettyXMLSerializer(Serializer):
         self.nm = nm = store.namespace_manager
         self.writer = writer = XMLWriter(stream, nm, encoding)
 
-        namespaces = {}
         possible = uniq(store.predicates()) + uniq(store.objects(None, RDF.type))
         for predicate in possible:
-            prefix, namespace, local = nm.compute_qname(predicate)
-            namespaces[prefix] = namespace
-        namespaces["rdf"] = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+            nm.compute_qname(predicate)
+
+        namespaces = {}
+        for p, n in nm.namespaces():
+            namespaces[p] = unicode(n)
         writer.push(RDF.RDF)
         writer.namespaces(namespaces.iteritems())
 
         # Write out subjects that can not be inline
         for subject in store.subjects():
+            assert subject
             if (None, None, subject) in store:
                 if (subject, None, subject) in store:
                     self.subject(subject, 1)
