createOdtDocument doesn't require a valid odt, and avoids you needing to do the namespace + header stuff here. If you search for other usages of createOdtDocument, you'll find examples of how to extract those elements back out. Easiest I'd suggest is getElementsByTagNameNS(...,...).