public Document buildBoard(Document document, Element root, ReversiBoard board) {
        Element boardElement = document.createElement("board");
        for (int i = 0; i < board.getBoard().length; i++) {
            Element position = document.createElement("position_" + i);
            Text text = document.createTextNode(String.valueOf(board.getBoard()[i]));
            position.appendChild(text);
            boardElement.appendChild(position);
        }
        root.appendChild(boardElement);
        return document;
    }