Removing PHP Dom dependency