I realize this is from a long time ago, but I just had this same problem.
During my build, we read the pom.xml using this sourceViewSupport object to identify the JDK version, which is then used to identify the container image to use for the build.
However, in our repository we enabled "merge with shelved changes", referencing a parameter (prompted variable) with a list of shelves.
If I kick off a build with a shelf that contains a change to pom.xml, that change is not manifested in sourceViewSupport.readSourceAsString. I understand why it does not, I perhaps should not have expected it to work.
However, is there a way to achieve this?