Moved used functions; removed unused xml functions