rv = aTemplateNode->ParseAttributeString(attribute, *getter_AddRefs(tag), nameSpaceID);
nsCOMPtr<nsINodeInfo> ni; rv = aTemplateNode->NormalizeAttributeString(attribute, *getter_AddRefs(ni));
nsXULTemplateBuilder::AddPersistentAttributes(nsIContent* aTemplateNode,                                              nsIRDFResource* aResource,                                              nsIContent* aRealNode){    nsresult rv;    nsAutoString persist;    rv = aTemplateNode->GetAttribute(kNameSpaceID_None, nsXULAtoms::persist, persist);    if (NS_FAILED(rv)) return rv;    if (rv != NS_CONTENT_ATTR_HAS_VALUE)        return NS_OK;    nsAutoString attribute;    while (persist.Length() > 0) {        attribute.Truncate();        PRInt32 offset = persist.FindCharInSet(" ,");        if (offset > 0) {            persist.Left(attribute, offset);            persist.Cut(0, offset + 1);        }        else {            attribute = persist;            persist.Truncate();        }        attribute.Trim(" ");        if (attribute.Length() == 0)            break;        PRInt32 nameSpaceID;        nsCOMPtr<nsIAtom> tag;        rv = aTemplateNode->ParseAttributeString(attribute, *getter_AddRefs(tag), nameSpaceID);        if (NS_FAILED(rv)) return rv;        nsCOMPtr<nsIRDFResource> property;        rv = gXULUtils->GetResource(nameSpaceID, tag, getter_AddRefs(property));        if (NS_FAILED(rv)) return rv;        nsCOMPtr<nsIRDFNode> target;        rv = mDB->GetTarget(aResource, property, PR_TRUE, getter_AddRefs(target));        if (NS_FAILED(rv)) return rv;        if (! target)            continue;        nsCOMPtr<nsIRDFLiteral> value = do_QueryInterface(target);        NS_ASSERTION(value != nsnull, "unable to stomach that sort of node");        if (! value)            continue;        const PRUnichar* valueStr;        rv = value->GetValueConst(&valueStr);        if (NS_FAILED(rv)) return rv;        rv = aRealNode->SetAttribute(nameSpaceID, tag, nsAutoString(valueStr), PR_FALSE);        if (NS_FAILED(rv)) return rv;    }    return NS_OK;}