update builder
don't rely on ownerDocument.baseURI for elements in templates.