Per XML prova ad usare JDOM. Per i .doc boh, il formato è proprietario e le specifiche non sono pubbliche..