When we have two workflows, W1 and W2, and W2 has a first step with a ID equal to other step ID in W1, WorkflowFactory retrieves erroneously the step in W1 when we ask about the first step in W2.
Specifically, the error is caused by WorkflowFactory#createFirstStep (in line https://github.com/DSpace/DSpace/blob/master/dspace-api/src/main/java/org/dspace/xmlworkflow/WorkflowFactory.java#L100).
For example, this error occurs if we have a configuration as in the attached file "workflow.xml".
Considering the previous example configuration, if we want to retrieve the "STEP_X" of the "default" workflow, the WorkflowFactory#createFirstStep will return the "STEP_X" of the "autoarchive" workflow.
This happens because the XPath expression passed to the XPathAPI in that line is erroneous, since that the expression uses the "//". The same error is described here, but in a different context (http://tech.forums.softwareag.com/techjforum/posts/list/8781.page).
If the "//" is removed of that expression, the error is solved. I tested this in my DSpace 5 environment.
I am not sure if i should make a pull request for this little issue.