Fixed namesapce error in createItemDocuemnt, and implemented loginDocument