Using Python, create a function to convert HTML to plain text.
Input HTML:
```
<p>Hello world!</p>
<div>
    <p>This is a test.</p>
</div>
```
import lxml.html as lh

def html_to_text(html):
    tree = lh.fromstring(html)
    return tree.text_content()

html = "<p>Hello world!</p><div><p>This is a test.</p></div>"

print(html_to_text(html))