def _parse_template(self, template, **kwargs): """Parse a template and return a XML fragment.""" parser = DracoParser() namespace = draco2.api.handler.copy() namespace.update(kwargs) opener = draco2.api.opener buffer = parser.parse(template, namespace=namespace, opener=opener) frag = self._parse_fragment(buffer) return frag