rdf_MakeRelativeRef(NS_ConvertUTF8toUCS2(mURLSpec), uri);
rdf_MakeRelativeRef(NS_ConvertUTF8toUCS2(mOriginalURLSpec.get()), uri);
RDFXMLDataSourceImpl::SerializeAssertion(nsIOutputStream* aStream,                                         nsIRDFResource* aResource,                                         nsIRDFResource* aProperty,                                         nsIRDFNode* aValue){    nsAutoString property, nameSpacePrefix, nameSpaceURI;    nsAutoString tag;    PRBool wasDefinedAtGlobalScope =        MakeQName(aProperty, property, nameSpacePrefix, nameSpaceURI);    if (nameSpacePrefix.Length()) {        tag.Append(nameSpacePrefix);        tag.AppendWithConversion(':');    }    tag.Append(property);    rdf_BlockingWrite(aStream, "    <", 5);    rdf_BlockingWrite(aStream, tag);    if (!wasDefinedAtGlobalScope && nameSpacePrefix.Length()) {        rdf_BlockingWrite(aStream, " xmlns:", 7);        rdf_BlockingWrite(aStream, nameSpacePrefix);        rdf_BlockingWrite(aStream, "=\"", 2);        rdf_BlockingWrite(aStream, nameSpaceURI);        rdf_BlockingWrite(aStream, "\"", 1);    }    nsIRDFResource* resource;    nsIRDFLiteral* literal;    if (NS_SUCCEEDED(aValue->QueryInterface(NS_GET_IID(nsIRDFResource), (void**) &resource))) {        nsXPIDLCString s;        resource->GetValue(getter_Copies(s));        nsXPIDLCString docURI;        nsAutoString uri = NS_ConvertUTF8toUCS2(s);        rdf_MakeRelativeRef(NS_ConvertUTF8toUCS2(mURLSpec), uri);        rdf_EscapeAttributeValue(uri);static const char kRDFResource1[] = " resource=\"";static const char kRDFResource2[] = "\"/>\n";        rdf_BlockingWrite(aStream, kRDFResource1, sizeof(kRDFResource1) - 1);        rdf_BlockingWrite(aStream, uri);        rdf_BlockingWrite(aStream, kRDFResource2, sizeof(kRDFResource2) - 1);        NS_RELEASE(resource);    }    else if (NS_SUCCEEDED(aValue->QueryInterface(NS_GET_IID(nsIRDFLiteral), (void**) &literal))) {        nsXPIDLString value;        literal->GetValue(getter_Copies(value));        nsAutoString s((const PRUnichar*) value);        rdf_EscapeAmpersands(s); // do these first!        rdf_EscapeAngleBrackets(s);        rdf_BlockingWrite(aStream, ">", 1);        rdf_BlockingWrite(aStream, s);        rdf_BlockingWrite(aStream, "</", 2);        rdf_BlockingWrite(aStream, tag);        rdf_BlockingWrite(aStream, ">\n", 2);        NS_RELEASE(literal);    }    else {        // XXX it doesn't support nsIRDFResource _or_ nsIRDFLiteral???        // We should serialize nsIRDFInt, nsIRDFDate, etc...        NS_ERROR("not an nsIRDFResource or nsIRDFLiteral?");    }    return NS_OK;}