in your master.kid :
...
<head py:match="item.tag=='{http://www.w3.org/1999/xhtml}head'">
...
<div py:replace="item[:]"/>
</head>
<body py:match="item.tag=='{http://www.w3.org/1999/xhtml}body'">
...
<!-- section imported from xxx.kid -->
<div id="content">
<div py:replace="item[:]"/>
</div>
...
</body>
...
in your variable content template :
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:py="http://purl.org/kid/ns#"
py:extends="'master.kid'">
<head>
<title>Too</title>
</head>
<body>
... the content to import into master.kid div...
</body>
</html>
Like this your master.kid could enclose the content of <head> and
<body> from template extending "master.kid"
is it usefull ?