How to read document type structure completely

I was wondering if you could help me with this.

I am trying to find a class in the webMethods API that would allow me to parse a document or a predefined document just for structural purposes. I am trying to create a dynamic service that would populate this document based on another input in the java service. I understand that I can initialize the document and get the structure but the initialize doesn’t initial a sub field if it is a document array or String array.

I should be able to read/find the fields that are not populated in the document.