Made it possible to pass XML to the constructor.