Is this code for an IS client that is connecting to IS? Or is it a Java service within IS?
If the latter, this is a classic example of when a Java service should not be used. Parsing an XML string into an IS document (IData structure internally) is the core capability of IS and FLOW.
The first bit of code looks off. It creates an IData var named pipeline and then tries to read variables out of it–those vars will never exist.
Since this is custom code, then you’ll need to make adjustments to determine which level “Details” you’re currently processing to create a document or a document list as desired. Assuming you’re invoking a service on IS which accepts or returns this structure, you may be able to use the the Tools | Generate Code… to create code for invoking the service from a client. That code can guide you on creating the document and document lists as desired.