impl xml document

separated the xml format from Document to its own class and relate them
with a interface