Let's create a new method for Element and Text called new_pseudo that does not require any arguments. Then we do not need the document variable any more.