Implementation of DOM