Buggy code:
public final class PackageRelationshipCollection implements Iterable < PackageRelationship > { private static POILogger logger = POILogFactory . getLogger ( PackageRelationshipCollection . class ) ; private TreeMap < String , PackageRelationship > relationshipsByID ; private TreeMap < String , PackageRelationship > relationshipsByType ; private PackagePart relationshipPart ; private PackagePart sourcePart ; private PackagePartName partName ; private OPCPackage container ; private int nextRelationshipId = - 1 ; PackageRelationshipCollection ( ) { } public PackageRelationshipCollection ( PackageRelationshipCollection coll , String filter ) { } public PackageRelationshipCollection ( OPCPackage container ) throws InvalidFormatException { } public PackageRelationshipCollection ( PackagePart part ) throws InvalidFormatException { } public PackageRelationshipCollection ( OPCPackage container , PackagePart part ) throws InvalidFormatException { } private static PackagePartName getRelationshipPartName ( PackagePart part ) throws InvalidOperationException { } public void addRelationship ( PackageRelationship relPart ) { } public PackageRelationship addRelationship ( URI targetUri , TargetMode targetMode , String relationshipType , String id ) { } public void removeRelationship ( String id ) { } public void removeRelationship ( PackageRelationship rel ) { } public PackageRelationship getRelationship ( int index ) { } public PackageRelationship getRelationshipByID ( String id ) { } public int size ( ) { } public void parseRelationshipsPart ( PackagePart relPart ) throws InvalidFormatException { try { PackageRelationshipCollection . logger . log ( DEBUG , ( "Parsing<seq2seq4repair_space>relationship:<seq2seq4repair_space>" + ( relPart . getPartName ( ) ) ) ) ; Document xmlRelationshipsDoc = DocumentHelper . readDocument ( relPart . getInputStream ( ) ) ; Element root = xmlRelationshipsDoc . getDocumentElement ( ) ; boolean fCorePropertiesRelationship = false ; <START_BUG> NodeList nodeList = root . getElementsByTagName ( RELATIONSHIP_TAG_NAME ) ; <END_BUG> int nodeCount = nodeList . getLength ( ) ; for ( int i = 0 ; i < nodeCount ; i ++ ) { Element element = ( ( Element ) ( nodeList . item ( i ) ) ) ; String id = element . getAttribute ( ID_ATTRIBUTE_NAME ) ; String type = element . getAttribute ( TYPE_ATTRIBUTE_NAME ) ; if ( type . equals ( CORE_PROPERTIES ) ) if ( ! fCorePropertiesRelationship ) fCorePropertiesRelationship = true ; else throw new InvalidFormatException ( "OPC<seq2seq4repair_space>Compliance<seq2seq4repair_space>error<seq2seq4repair_space>[M4.1]:<seq2seq4repair_space>there<seq2seq4repair_space>is<seq2seq4repair_space>more<seq2seq4repair_space>than<seq2seq4repair_space>one<seq2seq4repair_space>core<seq2seq4repair_space>properties<seq2seq4repair_space>relationship<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>package<seq2seq4repair_space>!" ) ; Attr targetModeAttr = element . getAttributeNode ( TARGET_MODE_ATTRIBUTE_NAME ) ; TargetMode targetMode = TargetMode . INTERNAL ; if ( targetModeAttr != null ) { targetMode = ( targetModeAttr . getValue ( ) . toLowerCase ( Locale . ROOT ) . equals ( "internal" ) ) ? TargetMode . INTERNAL : TargetMode . EXTERNAL ; } URI target = PackagingURIHelper . toURI ( "http:////invalid.uri" ) ; String value = element . getAttribute ( TARGET_ATTRIBUTE_NAME ) ; try { target = PackagingURIHelper . toURI ( value ) ; } catch ( URISyntaxException e ) { PackageRelationshipCollection . logger . log ( ERROR , ( ( "Cannot<seq2seq4repair_space>convert<seq2seq4repair_space>" + value ) + "<seq2seq4repair_space>in<seq2seq4repair_space>a<seq2seq4repair_space>valid<seq2seq4repair_space>relationship<seq2seq4repair_space>URI-><seq2seq4repair_space>dummy-URI<seq2seq4repair_space>used" ) , e ) ; } addRelationship ( target , targetMode , type , id ) ; } } catch ( Exception e ) { PackageRelationshipCollection . logger . log ( ERROR , e ) ; throw new InvalidFormatException ( e . getMessage ( ) ) ; } } public PackageRelationshipCollection getRelationships ( String typeFilter ) { } public Iterator < PackageRelationship > iterator ( ) { } public Iterator < PackageRelationship > iterator ( String typeFilter ) { } public void clear ( ) { } @ Override public String toString ( ) { } }

Fix:
NodeList nodeList = root . getElementsByTagNameNS ( RELATIONSHIPS , RELATIONSHIP_TAG_NAME ) ;